I'm not sure what to ask, but everything I try ends up with the error message "failed".
I was looking at the thread with Juan Antonio, and you said that it was common and could be dependent on the "machine". I'm guessing you meant the server on which the script is hosted as opposed to my local computer where I'm making requests. Right? If it were the latter, it would mean that GoDaddy is blocking my ability to use the script just because my IP doesn't have the best reputation here in Brazil (I checked, and it doesn't). However I'm guessing that GoDaddy isn't blocking socket connections based on that, so it would be GoDaddy's IP that would be in question, and they don't seem to have any IP issues.
If it's not that, could it be a firewall? I'm afraid I don't know much when it comes to all this SMTP stuff and socket connections.
Mike Gamble - 2011-04-15 22:26:49 - In reply to message 1 from Mike Gamble
I also wanted to add that I don't know what the localuser variable is supposed to be set to. I set the localhost to the domain where the script is hosted, but it looks like localuser is part of an email address. As far as I know, he has no email for that domain. Is there a default localuser name for hosting accounts? I see your script defaults to "root".
Manuel Lemos - 2011-04-16 04:39:55 - In reply to message 2 from Mike Gamble
It is possible that your hosting provider is blocking port 25 for outgoing connections. Port 25 is the default SMTP port. If it always fails when trying to establish a connection, that may be the case.
The class tries to validate an address by simulating a delivery of a message via SMTP to see if the recipient and sender addresses are accepted. But if your hosting provider always blocks port 25, the class cannot perform this test.
As for the localuser and localhost, usually it is not relevant, but it should be set to your e-mail address parts before and after the @ character respectively.
Mike Gamble - 2011-04-16 16:59:02 - In reply to message 3 from Manuel Lemos
I uploaded the script to my own hosting service and it works great. However GoDaddy's hosting has port 25 blocked just like you said, and they are using a relay server: relay-hosting.secureserver.net
I spent most of the day trying to figure out if I could modify your script to have it relay, but I didn't come up with anything. I was able to connect to the relay server through port 25, but I couldn't figure out how it would be possible to utilize your array of host IP's.
By the way, thanks for the great job you've done with phpclasses, and I know whenever I come across one of your scripts that it's high quality.
Manuel Lemos - 2011-04-16 21:31:43 - In reply to message 5 from Mike Gamble
In the case of GoDaddy, there is nothing that can be done to improve the class.
The class simulates the delivery of message by connecting to the SMTP server listed in the DNS MX records for the receipient domain. Since GoDaddy blocks connections to outside domains, you can't do that. Sending the message to GoDaddy SMTP server would not tell you nothing about the validity of the e-mail address.
The conclusion is that you can't do full e-mail validation with this class. You can at most validate the address with regular expressions and check if the DNS MX or A records for the given domain exist.
Mike Gamble - 2011-04-16 21:45:29 - In reply to message 6 from Manuel Lemos
Thank you very much for your help, Manuel. I'm glad I only have one client who uses GoDaddy. I think I'll just host your script here in Brazil, and he'll just have to make remote requests to access it.
Bob - 2014-08-23 13:20:40 - In reply to message 3 from Manuel Lemos
btw, i just got this message back... also, how do I test multiple email addresses, i have like 127,000 to clean up.
email domain gmail.com is valid because it is in the whitelist
Resolving host name "gmail-smtp-in.l.google.com"...
Connecting to host address "126.96.36.199"...
Resolving host name "alt1.gmail-smtp-in.l.google.com"...
Connecting to host address "188.8.131.52"...
Resolving host name "alt2.gmail-smtp-in.l.google.com"...
Connecting to host address "184.108.40.206"...
Resolving host name "alt3.gmail-smtp-in.l.google.com"...
Connecting to host address "220.127.116.11"...
Resolving host name "alt4.gmail-smtp-in.l.google.com"...
Connecting to host address "18.104.22.168"...
Manuel Lemos - 2014-08-23 22:11:34 - In reply to message 9 from Bob
This usually means that your server is blocking outgoing TCP connections remote servers. This usually happens if your are in shared hosting account; You may be able to overcome this problem if you upgrade to VPS or dedicated server.