PHP Classes

Unable to connect

Recommend this page to a friend!

      PHP Email validation  >  All threads  >  Unable to connect  >  (Un) Subscribe thread alerts  
Subject:Unable to connect
Summary:After various attempts, I cannot connect to any host address.
Messages:10
Author:Mike Gamble
Date:2011-04-15 22:03:50
Update:2011-04-16 21:45:29
 

  1. Unable to connect   Reply   Report abuse  
Picture of Mike Gamble Mike Gamble - 2011-04-15 22:03:50
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.

Thanks,
Mike

  2. Re: Unable to connect   Reply   Report abuse  
Picture of Mike Gamble 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".

  3. Re: Unable to connect   Reply   Report abuse  
Picture of Manuel Lemos 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.

  4. Re: Unable to connect   Reply   Report abuse  
Picture of Mike Gamble Mike Gamble - 2011-04-16 09:40:56 - In reply to message 3 from Manuel Lemos
Thanks

  5. Re: Unable to connect   Reply   Report abuse  
Picture of Mike Gamble 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.

  6. Re: Unable to connect   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-04-16 21:31:43 - In reply to message 5 from Mike Gamble
Thanks.

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.

  7. Re: Unable to connect   Reply   Report abuse  
Picture of Mike Gamble 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.

  8. Re: Unable to connect   Reply   Report abuse  
Picture of Bob Bob - 2014-08-23 13:15:21 - In reply to message 3 from Manuel Lemos
Sorry for diving into this thread, I'm unable to find the button/link to make a new post... but this one seems close enough to my problem.

Are there any documentation I can read, it seems I have to fill in some areas on this script...

btw, am i correct that this script will check the following:

1. take out typos
2. remove invalid emails
3. ping the email to see if it's a valid email that you can send to.
4. export all the good working emails that come back with a 250 OK code.


Thanks :)

Bob

  9. Re: Unable to connect   Reply   Report abuse  
Picture of Bob 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 "74.125.198.26"...
Failed.
Resolving host name "alt1.gmail-smtp-in.l.google.com"...
Connecting to host address "74.125.137.26"...
Failed.
Resolving host name "alt2.gmail-smtp-in.l.google.com"...
Connecting to host address "64.233.171.27"...
Failed.
Resolving host name "alt3.gmail-smtp-in.l.google.com"...
Connecting to host address "74.125.26.26"...
Failed.
Resolving host name "alt4.gmail-smtp-in.l.google.com"...
Connecting to host address "64.233.186.26"...
Failed.

  10. Re: Unable to connect   Reply   Report abuse  
Picture of Manuel Lemos 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.