Cannot send mail using SMTP from Droplet

October 20, 2019 157 views

I’m using nodemailer to send gmail from my Nodejs Application. It worked well on my local, but after push it to server it had error timeout. I think problem is Droplet blocked port 465, so my application fail to send mail. Please help me to resolve this.

1 Answer

Hi @jackynguyen93,

Are you sure there is a service listening on port 465? Please provide me with the result of the command

netstat -tulpen | grep 465

Additionally, can you please provide me with the configuration file of your application?

An Alternative would be just as you mentioned the port being blocked for outgoing connections. To allow outgoing connections from your server to server2 on TCP port 465, use this on your server :

iptables -A OUTPUT -p tcp -d <server2ip> --dport 465 -j ACCEPT


Have another answer? Share your knowledge.