Skip to content

Instantly share code, notes, and snippets.

@indriApollo
Created September 3, 2017 10:40
Show Gist options
  • Save indriApollo/1f18bf4939c9b26efd03512dd33c0d0c to your computer and use it in GitHub Desktop.
Save indriApollo/1f18bf4939c9b26efd03512dd33c0d0c to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
const nodemailer = require("nodemailer");
let smtpConfig = {
host: 'smtp.gmail.com',
port: 587,
secure: false, // upgrade later with STARTTLS
auth: {
user: '[email protected]',
pass: 'xxx'
}
};
let transporter = nodemailer.createTransport(smtpConfig);
transporter.sendMail({
from: '[email protected]',
to: '[email protected]',
subject: 'Message title',
text: 'Plaintext version of the message'
}, function(err, info) {
console.log(err);
console.dir(info);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment