Skip to content
Local Amazon Simple Email Service Server
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.babelrc
.eslintrc
.gitignore
.npmignore
.nycrc
.snyk
.travis.yml
Dockerfile
LICENSE
README.md
package-lock.json
package.json

README.md

aws-ses-local

Build Status Coverage Status Known Vulnerabilities scrutinizer npm package repo license

Creates local Amazon Simple Email Service Server for consuming requests sent by the API

Features

  • Stores html / text email and headers to output directory for viewing / testing
  • Returns file url of html email in place of MessageId

Supported Functions

Installation

npm install aws-ses-local -g

Running the server

aws-ses-local

CLI Options

Option Short Option Default Description
--outputDir -o ./output Specify output directory
--port -p 9001 Specify port for server to run on
--clean -c none Clean output directory (delete all contents)

Using the server

First, you need to install the AWS SDK then point it to the local server by specifying the endpoint

import AWS from 'aws-sdk'
const ses = new AWS.SES({ region: 'us-east-1', endpoint: 'http://localhost:9001' })

That's it! Now run sendEmail() with required params for eg.

ses.sendEmail({
  Destination: { /* required */
    BccAddresses: [
      'STRING_VALUE'
    ],
    CcAddresses: [
      'STRING_VALUE'
    ],
    ToAddresses: [
      'STRING_VALUE'
    ]
  },
  Message: { /* required */
    Body: { /* required */
      Html: {
        Data: 'STRING_VALUE' /* required */
      },
      Text: {
        Data: 'STRING_VALUE' /* required */
      }
    },
    Subject: { /* required */
      Data: 'STRING_VALUE' /* required */
    }
  },
  Source: 'STRING_VALUE', /* required */
  ReplyToAddresses: [
    'STRING_VALUE'
  ]
})
You can’t perform that action at this time.