Skip to content

Instantly share code, notes, and snippets.

@shivasurya
Created September 21, 2014 06:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shivasurya/ffec5c8121fb5043a3e4 to your computer and use it in GitHub Desktop.
Save shivasurya/ffec5c8121fb5043a3e4 to your computer and use it in GitHub Desktop.
node mailer - Node.js
var email = require('mailer');
email.send({
host : "smtp.gmail.com",
port : "465",
ssl : true,
domain : "i-visionblog.com",
to : "someone@someone.com",
from : "author@ivb.com",
subject : "Mailer library Mail node.js",
text: "Mail by Mailer library",
html: "<span> Hello World Mail sent from mailer library" ,
authentication : "login", // auth login is supported; anything else $
username : 'username@gmail.com',
password : '###########'
},
function(err, result){
if(err){ self.now.error(err); console.log(err); res.send("error occured"); }
else { console.log('hurray! Email Sent');
res.send("Email Sent")}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment