Cannot send mail using SMTP from Droplet

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.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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

Regards, KDSys