发布一个发邮件的module, 无需 SMTP server
发布于 12 年前 作者 guilin 5118 次浏览 最后一次编辑是 8 年前

去年写的, 一直没有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记录配置与发送地址匹配, 以免被视为垃圾邮件.

2 回复

这货不错!

不错的东西,不过如果个人用户的IP发邮件的话很多会因为各种各样的原因被拒收,比如查不到反向域名之类。。。

回到顶部