SMTP Connector


Code | npm

npm install reshuffle-smtp-connector

Reshuffle SMTP Connector

NPM Package: reshuffle-smtp-connector

This package is a Reshuffle connector that allows a developer to configure a transport that sends emails via SMTP.

The following code creates an HTTP endpoint at /ping. Sending a GET request to this endpoint with the following pattern, sends an email to the address in the to query parameter.

const { HttpConnector, Reshuffle } = require('reshuffle')
const { SMTPConnector } = require('reshuffle-smtp-connector')

const app = new Reshuffle()
const httpConnector = new HttpConnector(app)
const smtpConnector = new SMTPConnector(
    username: 'superman',
    password: 'hunter123',
    host: '',
    port: 587,
    fromName: 'Spiderman III',
    fromEmail: '',

    method: 'GET',
    path: '/ping',
  (event, app) => {
      subject: 'Ping Email',
      html: 'You have been pinged',


Hitting /ping? will send a ping email to

Configuration Options:

interface SMTPConnectorOptions {
  fromName: string // The sender name to appear on outgoing emails
  fromEmail: string // The sender email address to appear on outgoing emails
  host: string // SMTP host
  port: number // Port number for the host. Normally 587
  username: string // Username to login to the SMTP host
  password?: string // Password to login to the SMTP host

Connector actions

The SMTP connector provides the following actions:


send an email message defined by the message parameter. SMTPConnector.send(message: EmailMessage) The EmailMessage type expects the following:

interface EmailMessage {
  to: string // Recipient email address
  subject: string // Message subject
  html: string // message content
  attachments?: Attachment[]

Example on how to use this connector can be found here.