返回顶部

收藏

Node.JS发送邮件的简单代码

更多
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,outofmemory.cn</b>"

smtpTransport.sendMail mailOptions, (error, response)->
  if error then console.log(error)
  else  console.log("Message sent: " + response.message)
  smtpTransport.close()

标签:发送邮件,smpt,nodejs

收藏

0人收藏

支持

0

反对

0

发表评论