【问题标题】:Nodemailer send mail using gmail account showing response code 534-5.7.14Nodemailer 使用 gmail 帐户发送邮件,显示响应代码 534-5.7.14
【发布时间】:2019-10-18 12:36:10
【问题描述】:
// create reusable transporter object using the default SMTP transport

transporter = nodemailer.createTransport({
    host: 'smtp.gmail.com',
    port: 465,
    secure: true, 
    auth: {
        user: 'yourEmail', 
        pass: 'yourPassword' 
    }
});

{ [错误:无效登录] 代码:'EAUTH',响应:'534-5.7.14 请通过您的网络浏览器登录并\n534-5.7.14 然后尝试 再次。\n534-5.7.14 在 n534 5.7.14 了解更多信息 https://support.google.com/mail/answer/7875477sm13524842wml.20 - g smtp',响应代码:534 }

【问题讨论】:

    标签: node.js gmail nodemailer


    【解决方案1】:

    您可能需要在 Gmail 帐户中输入“Allow Less Secure Apps”(一直在底部)。您可能还需要“Allow access to your Google account”。

    【讨论】:

      【解决方案2】:
      var transporter = nodemailer.createTransport(smtpTransport({
          host: config.email_config.SMTP_HOST,
          port: config.email_config.SMTP_PORT,
          tls: {
              rejectUnauthorized: false
          },
          auth: {
              user: config.email_config.SMTP_AUTH_USER,
              pass: config.email_config.SMTP_AUTH_PASS
          }
      }));
      
      use like thiss....
      

      【讨论】:

        猜你喜欢
        • 2020-04-30
        • 2021-11-09
        • 2019-01-29
        • 2017-08-05
        • 1970-01-01
        • 2015-01-12
        • 1970-01-01
        • 1970-01-01
        • 2012-03-30
        相关资源
        最近更新 更多