Skip to content

Instantly share code, notes, and snippets.

@hamishdickson
Last active August 29, 2015 14:05
Show Gist options
  • Save hamishdickson/ea4b55ec257e639d1452 to your computer and use it in GitHub Desktop.
Save hamishdickson/ea4b55ec257e639d1452 to your computer and use it in GitHub Desktop.
var smtpTransport = nodemailer.createTransport({
service: 'service',
auth: {
user: 'username',
pass: 'password'
}
});
var mailOptions = {
from: 'from@email.com',
to: 'to@email.com',
subject: 'Email subject',
text: 'This is the main email body'
};
smtpTransport.sendMail(mailOptions, function (error, response) {
if (error) {
console.log('Error sending email' + error);
} else {
console.log('Email sent!';
}
smtpTransport.close();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment