Skip to content

Instantly share code, notes, and snippets.

@sallar sallar/index.js
Created Jun 27, 2017

Embed
What would you like to do?
SES Example
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: 'sallar@kaboli.org',
to: 'salar.kaboli@tieto.com',
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);
});
{
"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
You can’t perform that action at this time.