最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

如何从企业用户的节点js邮件。我应该使用哪些服务?

运维笔记admin12浏览0评论

如何从企业用户的节点js邮件。我应该使用哪些服务?

如何从企业用户的节点js邮件。我应该使用哪些服务?

而不是gmail我必须使用我的企业用户邮件ID我应该怎么做

const nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
    service: "Gmail",
    auth: {
      user: '[email protected]',
      pass: 'app password here'
    }
  });
transporter.sendMail(option, function(error, info){
    if (error) {
      console.log(error);
    } else {
      console.log('Email sent: ' + info.response);
    }
});
回答如下:

首先,不要将Gmail用于企业用途,它有很多限制。

我建议一个很好的选择:SendGrid(https://sendgrid),它是Google推荐的,甚至是谷歌云,因为Google Cloud似乎默认阻止外发SMTP(https://cloud.google/compute/docs/tutorials/sending-mail/)。

SendGrid支持2种发送邮件的方法,两者都很棒,每天100封邮件免费:

  • 通过HTTP请求
  • 通过SMTP
发布评论

评论列表(0)

  1. 暂无评论