繁体   English   中英

在node.js / nodemailer中发送电子邮件

[英]sending emails in node.js / nodemailer

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

但是,谷歌拒绝我的登录是可疑的,并认为我是黑客。

我试过发送电子邮件的雅虎。

我的问题是:

  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. 

我最近也玩这个,我从谷歌收到的错误只是说我需要创建一个特定于应用程序的密码。 请尝试按照此处的说明操作

至于第二个问题,我不知道为什么不能在生产中使用nodemailer的任何原因。

我使用了emailjs ,并且没有这个问题。 不确定是不是因为它是email.js,或者因为它是Google Apps与Gmail,或者谷歌因为某些原因对这款应用不太怀疑。 尝试三角测量可能有用:

$> 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) {   ... }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM