How send E-Mail in NODE JS || simplest way to send mail in node
-
Neel Bhardwaj
-
15-Jan-2022
-
0 comments
-
187
For play with email sytem in NODE JS. Firstly you install the nodemailer module.
STEP 1 :
npm i nodemailer
STEP 2 :
var nodemailer = require('nodemailer');
var transport = nodemailer.createTransport({
host:'smtp.gmail.com',
port:587,
secure:false,
requireTLS:true,
auth:{
user : 'test@gmail.com',
pass : '';
}
});
var mailOption = {
from : 'test@gmail.com',
to: 'xyz@gmail.com',
subject:'this is subject',
text:'This is the text send in mail'
}
transport.sendMail(mailOption,function(error,info){
if(error){
console.log(error);
}else{
console.log('Email send',info.response);
}
});
"Programming isn't about what you know,
it's about what you can figure out.”
Leave a reply
Thanks for comment. Your comment are shown after approve by ADMIN. THANKS!!
There is some server issue. Please try again. THANKS!!
Fatal error: Cannot declare class Connection, because the name is already in use in /home/d8ouyzxnuef4/public_html/thecoderjob.com/cj_admin/classes/Connection.php on line 3
Recent comments