Skip to content

Instantly share code, notes, and snippets.

@MPJHorner
Last active May 14, 2020 08:12
Show Gist options
  • Save MPJHorner/b1c01d929284b0963b75b5f255984b70 to your computer and use it in GitHub Desktop.
Save MPJHorner/b1c01d929284b0963b75b5f255984b70 to your computer and use it in GitHub Desktop.
Amazon SES NodeJS Test Script /w Configuration Set
var ses = require('node-ses')
var client = ses.createClient({
key: '%AWS_KEY_HERE%',
secret: '%AWS_SECRET_HERE%',
amazon: 'https://email.eu-west-2.amazonaws.com'
});
// Give SES the details and let it construct the message for you.
client.sendEmail({
to: 'other@rea.com',
from: 'somepl@ce.com',
cc: 'theWickedWitch@nerds.net',
bcc: ['canAlsoBe@nArray.com', 'forrealz@.org'],
subject: 'greetings',
message: 'your <b>message</b> goes here, <a href="https://google.com">Clicky Clicky (Click Tracking Test)</a>',
configurationSet: 'configuration-set-name',
altText: 'plain text'
}, function (err, data, res) {
if(err){
console.log(err);
}
console.log(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment