Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save webdelin/260559e2d7b7a22cd9ef7ddf09756d72 to your computer and use it in GitHub Desktop.
Save webdelin/260559e2d7b7a22cd9ef7ddf09756d72 to your computer and use it in GitHub Desktop.
const nodemailer = require('nodemailer')
const transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'in@gmail.com',
pass: 'passPASS'
}
});
const mailOptions = {
from: 'ext@gmail.com', // sender address
to: 'in@gmail.com,in2@gmail.com', // list of receivers
subject: 'Subject of your email', // Subject line
html: '<p>Your html here</p>'// plain text body
};
transporter.sendMail(mailOptions, function (err, info) {
if(err)
console.log(err)
else
console.log(info);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment