使用nodemailer发送邮件

  • 分类:【Nodejs
  • 浏览【569】
  • 评论【0】
  • 更新【2015-9-01 11:17:52】

var nodemailer = require('nodemailer');

var transporter = nodemailer.createTransport({

service: 'gmail',

auth: {

user: 'youname@gmail.com',

pass: 'password'

}

});

transporter.sendMail({

from: 'youname@gmail.com',

to: 'username@qq.com',

subject: 'hello',

text: 'hello world!'

});

这是一个最基本的邮件发送程序,邮件服务商有以下:

  • '1und1'
  • 'AOL'
  • 'DebugMail.io'
  • 'DynectEmail'
  • 'FastMail'
  • 'GandiMail'
  • 'Gmail'
  • 'Godaddy'
  • 'GodaddyAsia'
  • 'GodaddyEurope'
  • 'hot.ee'
  • 'Hotmail'
  • 'iCloud'
  • 'mail.ee'
  • 'Mail.ru'
  • 'Mailgun'
  • 'Mailjet'
  • 'Mandrill'
  • 'Naver'
  • 'Postmark'
  • 'QQ'
  • 'QQex'
  • 'SendCloud'
  • 'SendGrid'
  • 'SES'
  • 'Sparkpost'
  • 'Yahoo'
  • 'Yandex'
  • 'Zoho'

关键字词:nodemailer,邮件