Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Latest commit

 

History

History
59 lines (40 loc) · 1.28 KB

README.md

File metadata and controls

59 lines (40 loc) · 1.28 KB

Express Mail Gateway

This nodejs (Express JS) application will be used as mail gateway to hide sensitive information from the frontend. It is built as API gateway which receives a post request and enriches the message with the sensitive data and forwards everything to the mail gateway via SMTP provider.

Author

This repository was originally forked from 🔗 schadokar/nodemailer-app and enhanced with a couple of code snippets.

Installation

Clone the repository to your local folder:

git clone <reponame>

Install the nodejs dependencies with npm.

npm i

Configuration

Configure the application by using environment variables or a .env file with the following parameters.

SMTP_USER=<SMTP_USER>
SMTP_PASS=<SMTP_PASSWORD>
SMTP_DOMAIN=<SMTP_DOMAIN>
SMTP_PORT=<Port to be used e.g. 25>
[email protected],

Run the application

Dev mode:

npm run dev

Productive:

npm run start

Sample API Request

POST http://<hostname>:3000/api/v1/sendmail

REQUESTBODY
{
    "from": "[email protected]",
    "subject": "Subject for the mail",
    "message": {
        "test1":"test1Value",
        "test2":"test2Value"
    }
}