Skip to content

Instantly share code, notes, and snippets.

@iworkforthem
Created December 28, 2016 10:10
Show Gist options
  • Save iworkforthem/16a19c7fa05b97d149b96825415e7bfb to your computer and use it in GitHub Desktop.
Save iworkforthem/16a19c7fa05b97d149b96825415e7bfb to your computer and use it in GitHub Desktop.
send email with Amazon SES.
var nodemailer = require('nodemailer');
var ses = require('nodemailer-ses-transport');
var transporter = nodemailer.createTransport(ses({
accessKeyId: '',
secretAccessKey: '',
region: 'us-west-2'
}));
var mailOptions = {
from: '"NAME Team" <[email protected]>',
to: '[email protected]',
subject: 'My Email Subject',
html: '<p>Hi there!</p>'
//text: 'Hi there!'
};
transporter.sendMail(mailOptions, function(error, info) {
if (error) {
return console.log(error);
}
if (info) {
return console.log(info);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment