duaneleem of LeemTek
7/27/2017 - 5:15 AM

AWS SES example.

AWS SES example.

var aws = require("aws-sdk");
var ses = new aws.SES({"accessKeyId": "yourAccessId", "secretAccessKey": "yourAccessKey", "region": "your region"});
var eparam = {
    Destination: {
      ToAddresses: ["recipent@test.com"]
    },
    Message: {
      Body: {
        Html: {
          Data: "<p>Hello, this is a test email!</p>"
        },
        Text: {
          Data: "Hello, this is a test email!"
        }
      },
      Subject: {
        Data: "SES email test"
      }
    },
    Source: "sender@test.com",
    ReplyToAddresses: ["sender@test.com"],
    ReturnPath: "sender@test.com"
};
 
ses.sendEmail(eparam, function (err, data) {
  if (err) console.log(err);
  else console.log(data);
});