- Install necessary packages using
npm install
.
- Save your GCP dev account's client secrets in the directory with the name
client_secret.json
.
- Run the server using
node server.js
.
- Go to http://localhost:3000/api on your browser to start the OAuth process. This also saves access tokens to a local file.
- Now use Postman or a similar tool to make a POST request to http://localhost:3000/api/send with request JSON body of the form:
{
"to": "<insert recipient address>",
"subject": "<insert email subject>",
"messageBody": "<insert email body>"
}