Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nodemailer: Error connection timeout

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' }
like image 304
Dipesh Gupta Avatar asked Aug 05 '26 03:08

Dipesh Gupta


1 Answers

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.

like image 133
Anwar Hussain Avatar answered Aug 06 '26 17:08

Anwar Hussain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!