A simple Amazon SES wrapper, supports the following actions:
- DeleteVerifiedEmailAddress
- GetSendQuota
- GetSendStatistics
- ListVerifiedEmailAddresses
- SendEmail
- VerifyEmailAddress
Does not currently support SendRawEmail.
npm install amazon-ses
Or from source:
git clone git://github.com/jjenkins/node-amazon-ses.git cd amazon-ses npm link .
Verify the source email address with Amazon.
var AmazonSES = require('amazon-ses');
var ses = new AmazonSES('access-key-id', 'secret-access-key');
ses.verifyEmailAddress('foo@mailinator.com');
You will receive a confirmation email - click the link in that email to finish the verification process.
ses.send({
from: '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 html body of the message.'
}
});
ses.listVerifiedEmailAddresses(function(result) {
console.log(result);
});
ses.deleteVerifiedEmailAddress('foo@mailinator.com', function(result) {
console.log(result);
});
ses.getSendQuota(function(result) {
console.log(result);
});
ses.getSendStatistics(function(result) {
console.log(result);
});