Skip to content

Instantly share code, notes, and snippets.

@geeksilva97
Last active March 7, 2021 21:29
Show Gist options
  • Save geeksilva97/05c1996456b30f4a18348e2476009628 to your computer and use it in GitHub Desktop.
Save geeksilva97/05c1996456b30f4a18348e2476009628 to your computer and use it in GitHub Desktop.
const nodemailer = require('nodemailer');
const transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: '[email protected]',
pass: 'yourpassword',
},
});
transporter.sendMail({
from: '"Your Name" <[email protected]>', // sender address
to: "[email protected], [email protected]", // list of receivers
subject: "Medium @edigleyssonsilva ✔", // Subject line
text: "There is a new article. It's about sending emails, check it out!", // plain text body
html: "<b>There is a new article. It's about sending emails, check it out!</b>", // html body
}).then(info => {
console.log({info});
}).catch(console.error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment