Send Email with the Gmail API and Node.js
Go to cloud.google.com and create a new Google Cloud project. Give your project a name, and click the Create button.
Under the APIs and Services section, click on OAuth Consent Screen and set the user type as External and Click on create button.
In that screen you need following information
- App information ----> App-name
- App information ----> User support email
- Developer contact information ----> Email address
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
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.
6) Open https://developers.google.com/oauthplayground in new tab.
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.
9) Click on continue than it will be redirect into https://developers.google.com/oauthplayground.
In step 2 click on Exachange authorization code for tokens button
- Client ID, Client screte ID and refresh token ----> Add into environment file and use into node-app.