Created
July 27, 2013 05:55
-
-
Save FrankFang/6093937 to your computer and use it in GitHub Desktop.
send email in nodejs
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
nodemailer = require('nodemailer') | |
smtpTransport = nodemailer.createTransport "SMTP", | |
service: "QQ" | |
auth: | |
user: "***@qq.com" | |
pass: "*******" | |
mailOptions = | |
from: "frank ✔ <***@qq.com>" | |
to: "***@gmail.com" | |
subject: "Hello ✔" | |
text: "Hello world ✔" | |
html: "<b>Hello world ✔</b>" | |
smtpTransport.sendMail mailOptions, (error, response)-> | |
if error then console.log(error) | |
else console.log("Message sent: " + response.message) | |
smtpTransport.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment