Skip to content

Instantly share code, notes, and snippets.

@FrankFang
Created July 27, 2013 05:55
Show Gist options
  • Save FrankFang/6093937 to your computer and use it in GitHub Desktop.
Save FrankFang/6093937 to your computer and use it in GitHub Desktop.
send email in nodejs
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