Zend Mail Protocol Exception: Could not open socket


#1

I’ve been using the SimpleInvoices script for about the last 10 years. About a year ago whenever I tried to send an email from the script I’d receive the following error:-

Zend Mail Protocol Exception: Could not open socket.

I’ve tried various configurations but I still get an error of some sort. Here’s my config.

email.host = mail.mybusiness.com
email.smtp_auth = true
email.username = billing@mybusiness.com
email.password = mysecret
email.smtpport = 465
email.secure = SSL
email.ack = false

TIA for any suggestions


#2

email protocols is a dumpster fire :frowning: There is a reason why email sending services like sparkpost, mailgun etc are so popular: email is messy and complicated, takes nothing to break stuff. If those are not an option, here are a few things for you to try:

Is mail.mybusiness.com the CNAME for a mailserver hosted by DreamHost? Then try to find the real mail cluster’s name. https://help.dreamhost.com/hc/en-us/articles/214918038#Server_names

Make sure username and password are correct (I spent hours once debugging issues until I realized I was simply copying the wrong password)

Try port 587 and STARTTLS for secure protocol, too (sometimes it helps)

Some more articles with other details that may come in handy:



Also, keep an eye on the logs, try to connect to the smtp port via telnet from the server where the php script is hosted and let us know how things progress.


#3

Thanks Smaffulli, you solved it. Yes mail.mybusiness.com is a DH mail server, I changed it to sub3.mail.dreamhost.com and bingo!

email.host = sub3.mail.dreamhost.com
email.smtp_auth = true
email.username = billing@mybusiness.com
email.password = mysecret
email.smtpport = 465
email.secure = SSL
email.ack = false

Thanks for your help. I owe you a beer or two. Next time you’re down here in Sydney, Australia, let me know.


#4

Glad to be of help :slight_smile: And regarding the visit to Sidney… I might go there for this event: https://www.openstack.org/summit/sydney-2017/ LOL