Skip to content

rajputkuldeep/gmail-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gmail-api

Send Email with the Gmail API and Node.js

1) Create a Google Cloud Project

Go to cloud.google.com and create a new Google Cloud project. Give your project a name, and click the Create button.

Alt Text

2) Configure OAuth Consent Screen

Under the APIs and Services section, click on OAuth Consent Screen and set the user type as External and Click on create button.

Alt Text

3) Oauth consent screen

In that screen you need following information

  • App information ----> App-name
  • App information ----> User support email
  • Developer contact information ----> Email address Alt Text

Alt Text

4) Create Gmail OAuth Client

In the APIs & Services section, click on Credentials and click on Create credentials > OAuth Client Id to create a new client ID that will be used to identify your application to Google’s OAuth servers Alt Text

5) Application Type

Set the application type to Web application App, give your OAuth Client a recognizable name and in Authorized redirect URIs add https://developers.google.com/oauthplayground then click Create to generate the credentials.

Alt Text

In top right corner there is one setting icon click on that. after clicking you will see pop-up. in that pop-up you need to check-box at down corner **Use your own OAuth credentials. Fill client ID and client screte ID in that input fileds.Now close tha pop-up. Select step - 1 Select & authorize APIs in that input filed add https://mail.google.com. click on authorize APIs button. Alt Text

7) Select test account user that added in that Oauth consent screen.

Alt Text

8) Click on continue.

Alt Text

9) Click on continue than it will be redirect into https://developers.google.com/oauthplayground.

Alt Text

10) Refresh token

In step 2 click on Exachange authorization code for tokens button Alt Text

11) Get refresh token.

Alt Text

  • Client ID, Client screte ID and refresh token ----> Add into environment file and use into node-app.

About

Send Email with the Gmail API and Node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published