我应该使用什么类型的电子邮件来让 nodemailer 不被阻止

What type of email should I use for nodemailer to not get blocked

我试图找出问题所在,但一切都已正确配置。我用的是gmail,但是当我部署我的nodejs网站的时候,立马被封了。在我尝试 outlook 电子邮件后,设置时遇到了一些问题,但在本地主机上工作,也在服务器上工作。过了一天,我想试试,也被屏蔽了。当有人想在网站位于服务器上时发送电子邮件时,我应该使用什么类型的电子邮件,它是免费的,并且与 nodemailer 完美配合且不会阻塞?

let transporter = nodemailer.createTransport({
      host: "smtp-mail.outlook.com",
      secureConnection: false,
      port: 587,
      tls: {
        ciphers:'SSLv3'
      },
      auth: {
        user: 'example@outlook.com',
        pass: 'xxxx'
      }
    });

  let mailOptions = {
    from: '<example@outlook.com>',
    to: 'example@outlook.com',
    subject: 'Beküldött recept: ' + req.body.recipename,
    text: '',
    html: "",
    attachments: [{
      filename: imageName,
      path: newuploadPath
    }]
  };

我用了 Zoho mail,效果很好。确保在 mailOptionsfrom 字段中使用相同的 Zoho 电子邮件地址,否则会引发错误。

var transport = nodemailer.createTransport({
    host: 'smtp.zoho.eu',
    port: 465,
    secure: true, //ssl
    auth: {
        user:process.env.EMAIL,
        pass:process.env.EMAIL_PASSWORD
    }
});

var mailOptions = {
    from: process.env.EMAIL,
    to: req.body.email,
    subject: "Subject",
    html: ""
};

一般来说,Gmail 不是与 Nodemailer 一起使用的首选服务,因为它针对的是真实用户,而不是 automatic/programmed 使用。参见 Nodemailer with Gmail for more info. Also here is a list of alternative email services supported by Nodemailer WELL-KNOWN SERVICES