Created
June 27, 2017 10:46
-
-
Save sallar/308ba3dcc1116dd94bf01fcdbf82a0e9 to your computer and use it in GitHub Desktop.
SES Example
This file contains 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
const nodemailer = require('nodemailer'); | |
const aws = require('aws-sdk'); | |
// create Nodemailer SES transporter | |
const transporter = nodemailer.createTransport({ | |
SES: new aws.SES({ | |
apiVersion: '2010-12-01', | |
region: 'eu-west-1' | |
}) | |
}); | |
// send some mail | |
transporter.sendMail({ | |
from: '[email protected]', | |
to: '[email protected]', | |
subject: 'Message', | |
text: 'I hope this message gets sent!', | |
}, (err, info) => { | |
if (err) { | |
console.log(err); | |
return; | |
} | |
console.log(info.envelope); | |
console.log(info.messageId); | |
}); |
This file contains 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
{ | |
"name": "aws", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"aws-sdk": "^2.77.0", | |
"nodemailer": "^4.0.1", | |
"nodemailer-ses-transport": "^1.5.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment