Created
December 28, 2016 10:10
-
-
Save iworkforthem/16a19c7fa05b97d149b96825415e7bfb to your computer and use it in GitHub Desktop.
send email with Amazon SES.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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