Skip to content

Node.js microservice for sending to a whitelisted email

Notifications You must be signed in to change notification settings

jkk/micromailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

micromailer

A Node.js microservice for sending email to a whitelisted email address.

Works great with now.sh.

Example

Start the service and send an email:

PORT=3000 node index.js
curl -X POST --data "fromName=Test&subject=Hi&body=Hello&[email protected]" http://localhost:3000/send

Installation

Clone somewhere then create an .env file:

[email protected]
[email protected]
SMTP_HOST=email-smtp.us-east-1.amazonaws.com
SMTP_PORT=465
SMTP_USER=XXX
SMTP_PASSWORD=XXX
MAX_BODY_SIZE=10000

Deploy to now with:

now --dotenv

Or run locally:

node index.js

API

POST /send

The data payload can be JSON or URL-encoded (x-www-form-urlencoded).

  • fromName - name of sender
  • subject - email subject
  • body - plain-text email body
  • replyTo (optional) - reply-to email

About

Node.js microservice for sending to a whitelisted email

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published