Skip to content

Instantly share code, notes, and snippets.

@luetkemj luetkemj/node-mailer.js
Last active Jan 16, 2019

What would you like to do?
Nodemailer quick setup for gmail
const nodemailer = require('nodemailer');
const transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
type: 'OAuth2',
user: '',
clientId: 'XXX',
clientSecret: 'XXX',
refreshToken: 'XXX'
const mailOptions = {
from: 'My Name <>',
to: '',
subject: 'Hello!',
text: 'Hello World!!'
transporter.sendMail(mailOptions, function (err, res) {
} else {
console.log('Email Sent');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.