Reputation: 138
I am trying to send mail using nodemailer, and it throws "Connection Timeout" error after 30-40 seconds. Earlier the same code was working but after updating nodemailer and nodejs it stopped working.
nodemailer": "^4.1.0 nodeJs:v8.4.0 npm:5.4.1
Please help, Thanks in Advance.
Here is the trace:
{ Error: Connection timeout
at SMTPConnection._formatError (/root/apps/aprampar/node_modules/nodemailer/lib/smtp-connection/index.js:577:19)
at SMTPConnection._onError (/root/apps/aprampar/node_modules/nodemailer/lib/smtp-connection/index.js:550:20)
at Timeout._connectionTimeout.setTimeout (/root/apps/aprampar/node_modules/nodemailer/lib/smtp-connection/index.js:253:18)
at ontimeout (timers.js:469:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:264:5) code: 'ETIMEDOUT', command: 'CONN' }
Upvotes: 3
Views: 2236
Reputation: 155
This is the problem of the network firewall. In 95% of cases, it was due to the firewall protection of the network or windows defender firewall. Try to first switch off the windows defender firewall and if there is still this issue then try to change the network use (jio network). because some time firewall blocks the port 587 and we face that problem.
Upvotes: 1
Reputation: 3700
It turns out that in order for Google to authorize a third party server to access your account via SMTP, you have to enable “Less Secure Apps” on your gmail account.
Checkout the link:
https://myaccount.google.com/lesssecureapps?pli=1
Upvotes: 0