Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodemailer-ses-transport

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodemailer-ses-transport

SES transport for Nodemailer

  • 1.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18K
decreased by-19.38%
Maintainers
1
Weekly downloads
 
Created
Source

SES transport module for Nodemailer

Applies for Nodemailer v1+ and not for v0.x where transports are built-in.

Warning about AWS tokens

It has been reported that keys that have special symbols in it (ie. slash /) probably do not work and return signature errors. To overcome this, try to generate keys with only letters and numbers.

Usage

Install with npm

npm install nodemailer-ses-transport

Require to your script

var nodemailer = require('nodemailer');
var sesTransport = require('nodemailer-ses-transport');

Create a Nodemailer transport object

var transporter = nodemailer.createTransport(sesTransport(options))

Where

  • options defines connection data
    • ses - instantiated AWS SES object. If not provided then one is generated automatically using the other options
    • accessKeyId - optional AWS access key. Not used if options.ses is set.
    • secretAccessKey - optional AWS secret. Not used if options.ses is set.
    • sessionToken - optional session token. Not used if options.ses is set.
    • region - optional Specify the region to send the service request to. Defaults to us-east-1. Not used if options.ses is set.
    • httpOptions - A set of options to pass to the low-level AWS HTTP request. See options in the AWS-SES docs. Not used if options.ses is set.
    • rateLimit - optional Specify the amount of messages that can be sent in 1 second. 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 immediately.
    • maxConnections - optional Specify the maximum number of messages to be "in-flight" at any one point in time. Useful for preventing suffocation of an internet connection when sending lots of messages.
    • Destinations - optional Specify envelope info

Examples

Example 1. Use AWS credentials to set up the sender

var transport = nodemailer.createTransport(sesTransport({
    accessKeyId: "AWSACCESSKEY",
    secretAccessKey: "AWS/Secret/key",
    rateLimit: 5 // do not send more than 5 messages in a second
}));

Example 2. Use already existing AWS SES object instance

var ses = new AWS.SES({accessKeyId:....});
var transport = nodemailer.createTransport(sesTransport({
    ses: ses
}));

License

MIT

Keywords

FAQs

Package last updated on 01 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc