Skip to content

Instantly share code, notes, and snippets.

@willread
Created September 24, 2013 19:33
Show Gist options
  • Save willread/6690078 to your computer and use it in GitHub Desktop.
Save willread/6690078 to your computer and use it in GitHub Desktop.
Send email with nodemailer
var nodemailer = require("nodemailer");
var transport = nodemailer.createTransport("SMTP", {
service: "Gmail",
auth: {
user: "[email protected]",
pass: "******"
}
});
var options = {
from: "Full Name <[email protected]>",
to: "[email protected]",
subject: "Subject",
text: "",
html: ""
};
transport.sendMail(options, function(error, response){
if(error){
console.log(error);
}else{
console.log("Sent: " + response.message);
}
transport.close();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment