Nodemailer + Gmail: How to Send Emails from Node.js API using Gmail

In this post, we will show how to send emails using a Gmail account. We will start by setting up a Gmail OAuth2 application, generating the tokens, and then using these credentials within the Nodemailer transporter to access Gmail accounts without confronting Gmail security high-level issues in production mode.