Question
SMTP : Connection Refused
I currently am trying to connect to an external SMTP server so that I can send emails from a WP install using the WP Mail SMTP plugin. I’m not sure this is an issue from the hosting side here at DigitalOcean or from my email host but I’ve reached out to them and they said everything looks fine so I’m checking from this side.
Basically, I get the following debug output:
Connection: opening to ssl://mail.mysite.com:465, timeout=300, options=array ()
Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://mail.mysite.com:465 (Connection refused) [/var/www/html/wp-includes/class-smtp.php line 298]
SMTP ERROR: Failed to connect to server: Connection refused (111)
During my testing I tried to run a Netcat from the DigitalOcean Droplet and get:
nc: connect to mail.mysite.com port 465 (tcp) failed: Connection refused
However, if I run it from my local machine I get:
Connection to mail.mysite.com 465 port [tcp/urd] succeeded!
So that lead me to think maybe I do have an issue from the DigitalOcean side? I’m not sure but any guidance would be greatly appreciated.
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.
×