Skip to content

A simple contact form API that can be integrated in any website, Built with express and nodemailer

Notifications You must be signed in to change notification settings

zaidanali028/nodemailerapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Just a personal mailing telmplate for a contact form built with node js

You can clone and try though,I just contributed to open source!

Allow Your email account to allow less secured apps to send emails to your gmail

SETUP

> $ npm i (Run This Command To Install The Packages In The package.json )

Open models/send.js file and modify it with your details by configuring a .env file in the root of your porject's directory.

Add these fields in your .env file

    GMAIL_USER = your e-mail
    GMAIL_PASS =your password

I have already required .env moduel for you in models/send line 1

    require('dotenv').config()

Run npm start to test this API.Use Postman in testing Use x-www-form-urlencoded in the body section of postman Define sender'name and give it name value Define sender's email and give it a value of email And lastly,define sender's message and give it a value of message

API ROUTES

GET

/api/sendmail/

POST

/api/sendmail/contact

    ** AN EXAMPLE TO GET YOU STARTED **
    name   zaidanali
    email  developersavenue@gmail.com
    message Hello I am a subscriber to your website who sent you am email

CHEESE!

About

A simple contact form API that can be integrated in any website, Built with express and nodemailer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published