nodemailer automatic mail sending code example
Example 1: nodemailer
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: '[email protected]',
pass: 'yourpassword'
}
});
const mailOptions = {
from: '[email protected]',
to: '[email protected]',
subject: 'Subject of your email',
html: '<p>Your html here</p>'
};
transporter.sendMail(mailOptions, function (err, info) {
if(err)
console.log(err)
else
console.log(info);
});
Example 2: Send redirect URL in the text body of mail using nodemailer
Send redirect URL in the text body of mail using nodemailer