var smtpTransport = require('nodemailer-smtp-transport'); var transport = nodemailer.createTransport(smtpTransport({ service: 'gmail', auth: { user: 'myemail@gmail.com', // my mail pass: 'mypassword' } }));