Skip to content

Used the nodemailer to generate emails with Gmail Oauth

Notifications You must be signed in to change notification settings

chinma-yyy/nodemailer_gmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodemailer for Gmail

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

CLIENT_ID

CLIENT_SECRET

USER

REFRESH_TOKEN

Here, I have used config.js file for these variables.

Explanation

  1. Create your own client with your credentials and set refreshtoken to identify the Oauth user.
  2. You can get the access_token from the OAuth2_client.
 const access_token = await OAuth2_client.getAccessToken()
  1. Now create a transporter for the mail with the required details.
  2. Create your message using documentation and send it. Bass!!!

About

Used the nodemailer to generate emails with Gmail Oauth

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published