【问题标题】:sending emails in node.js / nodemailer在 node.js / nodemailer 中发送电子邮件
【发布时间】:2013-08-13 05:27:22
【问题描述】:

我尝试使用 nodemailer 使用我的 gmail 帐户发送电子邮件。

但是,Google 拒绝了我的登录,认为我是一名黑客。

我试过 Yahoo,它确实会发送电子邮件。

我的问题是:

  1) How can I configure nodemailer to send emails thru gmail
  2) Standard/Reliable email library in node.js community with good support that can be used in production.

【问题讨论】:

    标签: node.js nodemailer


    【解决方案1】:

    我最近也在玩这个,我从 Google 收到的错误只是说我需要创建一个应用程序特定的密码。尝试按照here 的说明进行操作。

    关于你的第二个问题,我不知道为什么 nodemailer 不能在生产中使用。

    【讨论】:

      【解决方案2】:

      我使用了emailjs,并没有遇到这个问题。不确定这是因为它是 email.js 还是因为它是 Google Apps 与 Gmail,或者 Google 出于某种原因对这个应用程序的怀疑程度较低。尝试三角测量可能有用:

      $> npm install emailjs

         emailjs = require('emailjs');
      
         ...
      
      var server = emailjs.server.connect({
              user:"myname@mygoogleapp.com",
              password:"Secret@!1",
              host:"smtp.gmail.com",
              ssl:true
            });
      
       server.send({
                text: message
                from:"Display name <return@mydomain.com>",
                to:email,
                subject:"Subject"
              },
              function (err, message) {   ... }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-08-23
        • 2020-11-17
        • 2019-11-05
        • 2021-08-06
        • 1970-01-01
        • 2022-01-21
        • 1970-01-01
        相关资源
        最近更新 更多