Socket
Socket
Sign inDemoInstall

aws-ses-v2-local

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-ses-v2-local

A local version of Amazon Simple Email Service (AWS SES) supporting the V2 API


Version published
Weekly downloads
8.8K
decreased by-7.05%
Maintainers
1
Weekly downloads
 
Created
Source

aws-ses-v2-local

A local version of Amazon Simple Email Service (AWS SES) supporting the V2 API. Currently focuses on the SendEmail endpoint.

Screenshot of the email viewer tool

Install

npm install aws-ses-v2-local

Usage

Setting up aws-ses-v2-local

You can run it as a command line tool (in your package.json scripts, or install it globally with the -g flag)

aws-ses-v2-local

Alternatively, you can import it and run it yourself (along with optional config for the port):

import server from 'aws-ses-v2-local'

server({ port: 8005 })
console.log('The aws-ses-v2-local server is up and running!')

Setting up your application

You can treat the server as an AWS SES endpoint. For example in JavaScript/TypeScript with the V3 SDK:

import { SESv2Client, SendEmailCommand, SendEmailCommandInput } from "@aws-sdk/client-sesv2"

const sesClient = new SESv2Client({ endpoint: "http://localhost:8005" })
const command = new SendEmailCommand({
    Content: {
        Simple: {
            Body: { Text: { Data: 'This is the email contents' } },
            Subject: { Data: 'This is the subject' }
        }
    },
    Destination: { ToAddresses: ['receiver@example.com'] },
    FromEmailAddress: 'sender@example.com',
})
const data = await sesClient.send(command)

Or with the V2 SDK:

import { SESv2Client, SendEmailCommand, SendEmailCommandInput } from "@aws-sdk/client-sesv2"

const sesClient = new AWS.SESV2({ endpoint: "http://localhost:8005" })
const params = {
    Content: {
        Simple: {
            Body: { Text: { Data: 'This is the email contents' } },
            Subject: { Data: 'This is the subject' }
        }
    },
    Destination: { ToAddresses: ['receiver@example.com'] },
    FromEmailAddress: 'sender@example.com',
}
sesClient.sendEmail(params)

Viewing emails

Navigate to the address and port where the server is running in your browser (e.g. localhost:8005).

FAQs

Package last updated on 04 Nov 2021

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