简体   繁体   English

nodemailer SMTP 服务器连接问题(错误:连接 ETIMEDOUT)但它适用于不在我的另一个系统

[英]nodemailer SMTP server connection issue (Error: connect ETIMEDOUT) but it works for another system not in mine

Iam trying to send node mailer using webmail instead of GMail using smtp sever as follows..我正在尝试使用 webmail 而不是 GMail 使用 smtp 服务器发送节点邮件,如下所示..

// config connections
"nodemailer" : { 
         
         "host": "smtp.in-sciencelabs.com",
         "port": 587,
        "auth": {
        "user": "myuser.com", 
        "pass": "myp@ssword"
    }

// in nodemailer.js code iam importing the config details.... // 在 nodemailer.js 代码中,我正在导入配置详细信息....

const transporter=
nodemailer.createTransport(smtpTransport((config["nodemailer"])));
     var mailOptions = {
               from: `${config["nodemailer"]["user"]}`,
               to: tomail,
               subject: subject ,
               text: data
             };
             transporter.verify(function(error, success) {
               if (error) {
                 console.log(error,"17");
               } else {
                 console.log("Server is ready to take our messages");
               }
             });

i tried to verify the connections so its shows an error like this我试图验证连接,所以它显示这样的错误

(Error: connect ETIMEDOUT)***.**.***.***:587
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -4039,
  code: 'ECONNECTION',
  syscall: 'connect',
  address: 'xxx.xx.xxx.xxx',
  port: 587,
  command: 'CONN'
}

here iam trying this but its not workout for me but in another system emails are sending so i dont know which setting is going to change in system for sending an email could you please help me out from this problem and i also changed the node version to 12.18.3我在这里尝试这个,但它对我来说不是锻炼,但在另一个系统中正在发送电子邮件,所以我不知道发送 email 的系统中哪个设置会改变,你能帮我解决这个问题吗?我也将节点版本更改为12.18.3

Have you looked at this answer .你有没有看过这个答案

It turns out that in order for Google to authorize a third party server to access your account via SMTP now, you have to enable “Less Secure Apps” on your gmail account, if you want to use username/password ( more info here ).事实证明,为了让 Google 现在授权第三方服务器通过 SMTP 访问您的帐户,如果您想使用用户名/密码(更多信息在这里),您必须在您的 gmail 帐户上启用“安全性较低的应用程序”。

So you have two option:所以你有两个选择:

  • use OAuth使用 OAuth

  • make your account less secure降低您的帐户安全性

you also need to check your server firewall setting, This may be firewall problem, Problem can be solved by enabling TCP inbound and outbound in firewall settings on your server, if you are using digital ocean then you can find it in firewall settings in panel您还需要检查您的服务器防火墙设置,这可能是防火墙问题,可以通过在服务器上的防火墙设置中启用 TCP 入站和出站来解决问题,如果您使用的是数字海洋,那么您可以在面板的防火墙设置中找到它

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

相关问题 nodemailer && mailtrap -> 连接 ETIMEDOUT 错误 - nodemailer && mailtrap -> connect ETIMEDOUT error {在nodemailer中的[[错误:连接超时]代码:'ETIMEDOUT'} - { [Error: Connection timeout] code: 'ETIMEDOUT' } in nodemailer Nodemailer - 错误:连接 ETIMEDOUT 216.58.221.36:587 - Nodemailer - Error: connect ETIMEDOUT 216.58.221.36:587 在 aws 上使用 Godaddy SMTP 服务器的 Nodemailer 连接超时错误 - Nodemailer connection timeout error using Godaddy SMTP server on aws 连接失败:错误:连接 ETIMEDOUT - Connection fails: Error: connect ETIMEDOUT Nodemailer - 发送邮件时出错:连接 ETIMEDOUT 204.79.197.212:587 - Nodemailer - Error while sending mail: connect ETIMEDOUT 204.79.197.212:587 Nodemailer“连接ETIMEDOUT”与自定义域 - Nodemailer “connect ETIMEDOUT” with custom domain "在 Nodejs Openshift 应用程序中使用 nodemailer 的 ETIMEDOUT 连接错误" - ETIMEDOUT connect error using nodemailer in Nodejs Openshift application 带有 gmail 的 Nodemailer 收到 ETIMEDOUT 错误 - Nodemailer with gmail get ETIMEDOUT error 节点 js 服务器设置正确,但我仍然收到没有连接的错误(nodemailer SMTP 方法) - node js server is setup correctly implemented still I am getting error that there's no connection to it(nodemailer SMTP method)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM