UNPKG

1.34 kBMarkdownView Raw
1# SES transport module for Nodemailer
2
3Applies for Nodemailer v1.x and not for v0.x where transports are built-in.
4
5## Usage
6
7Install with npm
8
9 npm install nodemailer-ses-transport
10
11Require to your script
12
13```javascript
14var nodemailer = require('nodemailer');
15var sesTransport = require('nodemailer-ses-transport');
16```
17
18Create a Nodemailer transport object
19
20```javascript
21var transporter = nodemailer.createTransport(sesTransport(options))
22```
23
24Where
25
26 * **options** defines connection data
27 * **accessKeyId** - *optional* AWS access key.
28 * **secretAccessKey** - *optional* AWS secret.
29 * **sessionToken** - *optional* session token.
30 * **region** - *optional* Specify the region to send the service request to. Default to *us-east-1*
31 * **rateLimit** - *optional* Specify the amount of messages that [can be sent in 1 second](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html). For example if you want to send at most 5 messages in a second, set this value to 5. If you do not set it, rate limiting is not applied and messages are sent out immediatelly.
32
33**Example**
34
35```javascript
36var transport = nodemailer.createTransport(sesTransport({
37 accessKeyId: "AWSACCESSKEY",
38 secretAccessKey: "AWS/Secret/key",
39 rateLimit: 1 // do not send more than 1 message in a second
40}));
41```
42
43## License
44
45**MIT**