Nodemailer

Send mails from Gmail using Nodemailer

Gists This is a sample script for sending e-mails from gmail using Nodemailer. In order to use this, please retrieve the folloing parameters before run this script. gmail address client ID client Secret Refresh token Please include https://mail.google.com/ in the scope. Enable gmail API at API console. Install Nodemailer const nodemailer = require('nodemailer'); var auth = { type: 'oauth2', user: '### your gmail address ###', clientId: '### client ID ###', clientSecret: '### client secret ###', refreshToken: '### refresh token ###', }; var mailOptions = { from: '#####', to: '#####', subject: 'sample subject', text: 'sample text', html: '<b>sample html</b>', }; var transporter = nodemailer.