This is a small NodeJs server. Main and only feature is:
- to send email to you with given configuration.
Use case: A backend service for a website contact form. When a person gives his/her name
, email address
, subject of message
and the message
sent to you. The endpoint will send you an email.
git clone https://github.com/alexIslander/nodejs-mailsending-master.git
npm i
Change gmail user name and password (given in example).
Create/change a '.env' file with following content:
PORT=<port_number_of_your_serivce>
MAIL_SERVER=<your_mail_server>
USER=<user_on_mail_Server>
PWD=<user_password>
TO_EMAIL=<targer_email_address>
Example gmail config:
PORT=5000
MAIL_SERVER=smtp.gmail.com
[email protected]
PWD=Password1
[email protected]
npm start
It can be tested from POSTMAN. See details in postman_test.JPG
.