Skip to content

Dyoniso/Node-XEmail-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node XEmail API

Convert HTTP traffic into a Simple Email

First Step

Install Node Server

  1. Clone the repository
git clone https://github.com/Dyoniso/XV1-Email-API
  1. Inside repository, run npm start
npm start .

API Config

In order to be able to send e-mail, configure the .env file with the credentials of your e-mail server.

#API
X_API_KEY='your_key' #Access API

#HTTP SERVER
HTTP_HOST = localhost #Server Host
HTTP_PORT = 8081 #Server Port

#SMTP SERVER
SMTP_SERVICE = 'EMAIL-SERVICE' #ex: GMAIL
SMTP_LOGIN = 'SMTP-LOGIN'
SMTP_PASSWORD = 'SMTP-PASSWORD'
SMTP_SECURE = off #SSL? ON or OFF
SMTP_PORT = 'SMTP-PORT'
SMTP_SENDER_EMAIL = 'EMAIL OF SEND' #[email protected]

With the API running, make a POST request at the following path: /mail/send put the following parameters in the body.

{
   "receiver":"[email protected]",
   "subject":"Awesome email written in Node",
   "text":"Very easy!",
   "html":"<h1> Strong Email </h1>"
}

With everything finished, the receiver will receive an email in the inbox.

Happy hacking!

About

Simple Node Email API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published