Skip to content

API in Node JS using express to send emails using the Gmail REST API. Without any client library

Notifications You must be signed in to change notification settings

RohitsSkill/mailSender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mailSender

API in Node JS using express to send emails using the Gmail REST API. Without any client library

Here is the code for sending Email using gmail api here is not created front-end code. It is just a back-end code writen in javascript

Step to run it

First go to : https://console.developers.google.com/apis then create new project add api then give name and continue steps........

After creating project go to credential tab create new creadentials select scopes as https://www.googleapis.com/auth/gmail.readonly and https://www.googleapis.com/auth/gmail.send give redirect uri as 'http://localhost:3000/sendmail' this will help user to dont log-in next time submit creadential download credentials.json file which will shown by google to you after submiting the credential.

Now go to terminal and create folder for project and move into it now run following commands


npm init


npm install express


Copy index.js file from my repository into your folder and copy that credentials.json file into your folder and run final command on terminal


node .


go to localhost:3000/{email_receiver}/{subject_of_email}/{message}

Now see your mail box.........

hope this is good for you for any help contact LinkedIn : Rohit Pawar

Thanks for Reading 😄

About

API in Node JS using express to send emails using the Gmail REST API. Without any client library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages