Created
September 21, 2014 06:55
-
-
Save shivasurya/ffec5c8121fb5043a3e4 to your computer and use it in GitHub Desktop.
node mailer - Node.js
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 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