January 9th, 2013, 09:58 AM
Email verification scripts - connection being refused
I was looking for email verification scripts. When I test these out with examples, hotmail etc refuse my connection
Warning: fsockopen() [function.fsockopen]: unable to connect to mx2.hotmail.com:25 (Connection refused
Q: so how else should i be trying to verify email addresses?
i know it is not 100% unless I email the address.
script example that i used:
January 9th, 2013, 10:24 AM
Does your webhost support fsock
Originally Posted by paulh1983
January 9th, 2013, 11:07 AM
thanks for the reply. It is enabled but not working on that particular script
i say it is working as a test script worked fine
Last edited by paulh1983; January 9th, 2013 at 11:11 AM.
January 9th, 2013, 12:13 PM
Are you sure you are using the correct server?
mx2.hotmail.com:25 seems unlikely to be the correct server to me. Why are you not using the SMTP server of the webhost?
January 9th, 2013, 01:35 PM
mx2.hotmail.com is an MX record for both @hotmail.com and @msn.com so that looks right.
Some mail servers will block connections or emails from blacklisted (eg, Spamhaus) sources. Depending how paranoid your verification needs to be, I might simply check if there is at least one MX record that resolves to an IP address.
January 9th, 2013, 01:39 PM
well i am using the script i found on the net so going along with whatever they are doing.
I changed the port from 25 to a random one but now the server hangs and i get an apache error
January 9th, 2013, 02:01 PM
thanks for that but what that script is doing is sending a "hello" message to check whether the actual email is valid and not just the domain part.
i.e. email@example.com and firstname.lastname@example.org both will have a "true" domain and hence a true MX record.
Any other script would be helpful
January 9th, 2013, 02:30 PM
A HELO? You mean trying a RCPT TO?
That's how you would do it, but if you can't connect then all the verification scripts in the world won't help. Can you connect to mx2.hotmail.com yourself from that machine?
January 9th, 2013, 06:11 PM
ok i have tried again and this is the response I got from hotmail:
220 BAY0-MC4-F26.Bay0.hotmail.com Sending unsolicited commercial or bulk e-mail to Microsoft's computer network is prohibited. Other restrictions are found at http://privacy.microsoft.com/en-us/anti-spam.mspx. Wed, 9 Jan 2013 15:09:03 -0800
Does this mean I won't be able to get info from hotmail?
January 9th, 2013, 07:17 PM
No, getting that announcement (which is what it is) is good. Are you saying the script works now, or at least isn't generating the "connection refused" errors?
January 9th, 2013, 10:35 PM
Your webhosts IP may be banned from msn servers due to other users using the host to send spam.
Have you tried using the php mail extension and sending an email validation link? that way you know that it is valid and belongs to the user
Originally Posted by requinix
Comments on this post
January 10th, 2013, 05:02 AM
Well i tried that script from my installation on Linux rather than through my web hosting company and that is when it appeared to work.
when I tried to check an email address hosted by another company, I actually recieved the response saying whether the email was valid or not. but when I try the hotmail one, it seems that this message is a generic one they respond with without actually telling us whether the email in question is valid or not.
January 11th, 2013, 11:01 PM
Why are you checking just the validity/existance of the email rather than checking for ownership of the email??
January 14th, 2013, 04:30 AM
well I was asked by my manager whether when user sign up to our services//competitions, if there is a way we could check if the emails entered actually exist. for example: email@example.com may be a valid format but not necessarily exist.
But you know what, you have posed a valid question, if we dont check for the ownership then anyone can put an email address for another person..
January 14th, 2013, 03:31 PM
Yes and you will be in violation of many laws and TOS agreements with email providers resulting in your domain, associated ip's and email addresses being black listed.
You should create a truly random id, store the id with their name and email address, email the id to the user within a URL link requesting both the userid and unique id via get method.
This will bypass the issues of mail servers not providing results to your whois searches of email addresses, and provide more useful data.
Originally Posted by paulh1983