antoinerousseau / node-amazon-ses

A simple wrapper for Amazon Simple Email Service (Amazon SES)

Home Page:https://aws.amazon.com/ses/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Amazon SES

A simple Amazon SES wrapper, supports the following actions:

  • DeleteVerifiedEmailAddress
  • GetSendQuota
  • GetSendStatistics
  • ListVerifiedEmailAddresses
  • SendEmail
  • VerifyEmailAddress

Does not currently support SendRawEmail.

Install

npm install amazon-ses-mailer

Verify Source Email

Verify the source email address with Amazon.

var AmazonSES = require('amazon-ses-mailer');
var ses = new AmazonSES('access-key-id', 'secret-access-key', 'region');
ses.verifyEmailAddress('foo@mailinator.com');

You will receive a confirmation email - click the link in that email to finish the verification process.

Send Email

ses.send({
    from: 'Foo <foo@mailinator.com>'
  , to: ['bar@mailinator.com', 'jim@mailinator.com']
  , replyTo: ['john@mailinator.com']
  , subject: 'Test subject'
  , body: {
        text: 'This is the text of the message.'
      , html: 'This is the <b>html</b> body of the message.'
  }
});

Get verified email addresses

ses.listVerifiedEmailAddresses(function(result) {
  console.log(result);
});

Deleted a verified email address

ses.deleteVerifiedEmailAddress('foo@mailinator.com', function(result) {
  console.log(result);
});

Get Quota and Stats

ses.getSendQuota(function(result) {
  console.log(result);
});

ses.getSendStatistics(function(result) {
  console.log(result);
});

About

A simple wrapper for Amazon Simple Email Service (Amazon SES)

https://aws.amazon.com/ses/

License:MIT License


Languages

Language:JavaScript 100.0%