去年写的, 一直没有publish到npm
https://github.com/guileen/node-sendmail
npm install sendmail
var sendmail = require('sendmail').sendmail;
sendmail({
from: 'test[@yourdomain](/user/yourdomain).com',
to: 'test[@qq](/user/qq).com, test[@sohu](/user/sohu).com, test[@163](/user/163).com ',
subject: 'test sendmail',
content: 'Mail of test sendmail ',
}, function(err, reply) {
console.log(err && err.stack);
console.dir(reply);
});
虽然无需SMTP服务器, 但最好还是将域名的MX记录配置与发送地址匹配, 以免被视为垃圾邮件.