Created
September 21, 2014 07:01
-
-
Save shivasurya/e284113fa6bef4028fb8 to your computer and use it in GitHub Desktop.
nodemailer library - nodemailer
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
var nodemailer = require("nodemailer"); | |
var smtpTransport = nodemailer.createTransport("SMTP",{ | |
service: "Gmail", | |
auth: { | |
user: "username@gmail.com", | |
pass: "########################" | |
} | |
}); | |
smtpTransport.sendMail({ | |
from: "S Shivasurya <s.shivasurya@gmail.com>", // sender address | |
to: "S Shivasurya <someone@someone.com>", // comma separated list of receivers | |
subject: "Mail from Nodemailer", // Subject line | |
text: "Hello world - this mail is sent from nodemailer library" // plaintext body | |
}, function(error, response){ | |
if(error){ | |
console.log(error); | |
}else{ | |
console.log("Mail sent: " + response.message); | |
} | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment