This API helps in authorizing the application by using Oauth2.0 and after authorization you can send email from your account on behalf of this API.
- Clone or Download the project
- Setup the project and run command "npm start"
- Go to localhost:8000/ and follow the on screen instructions.
There are three API endpoints in this Application
- localhost:8000/ this is just a welcome screen for this application
- localhost:8000/login this is the endpoint used for Auth
- localhost:8000/credentials this is the api endpoint used in the process of authorization.
- localhost:8000/sendmail this is the endpoint to send a brebuilt mail to a sender which is predefined in the code ,follow the code comments to change reciever's email.
When you go to localhost:8000/login , this api endpoint will redirect you to the google authorization server after you authorize the application google server will send us a AuthToken (with the help of localhost:8000/credentials) this auth token is then used to exchange with AccessToken once we get the accesstoken we call the gmail API to send mail