Last active
October 29, 2016 02:30
-
-
Save matthewepler/d272d70ae486eb969cf36e8450f03ba3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const nodemailer = require('nodemailer'); | |
function sendMail() { | |
const transporter = nodemailer.createTransport({ | |
service: 'Gmail', | |
auth: { | |
user: 'ggdb.info@gmail.com', | |
pass: '<password>' | |
} | |
}); | |
const mailOptions = { | |
from: 'ggdb.info@gmail.com', | |
to: email, | |
subject: 'test email', | |
text: 'test test' | |
}; | |
transporter.sendMail(mailOptions, function(error, info) { | |
if (error) { | |
console.log("Error while sending email.", error); | |
} | |
if (info) { | |
console.log("info from sendMail: ", info); | |
} | |
console.log('email sent.'); | |
}); | |
} | |
sendMail(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment