is there any script or tool available for verifying an email addresses can you guys tell me how this is done?
no the only thing you can do is check that the submitted e-mail address is formatted correctly, all you can do for validation is to send an email to the address and make them click a link
You can use either of these regular expressions to validate email addresses (you may need to throw some other characer into ranges): ^[-a-z0-9\.]+@(?:[-a-z0-9]+\.){1,32}[a-z]+$ A less restrictive form: ^[^@]+@(?:[^\\.]+\.){1,32}[a-z]+$ Note, though, that by the spec, parts of an email address may be quoted and may contain comments, creating email addresses that cannot be parsed with a simple regular expression like these (e.g. name(this is my address\.)@host.com is a valid email address). ISPs usually don't allow such addresses and you should be safe with the regular expressions above. J.D.
There are some scripts which query the MX record of the email domain and find whether a email is really present in the mail server but that is taking things a bit too far I guess !
here is a sample script if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){ echo "<li>You enter invalid emial address"; exit; } Code (markup):
Oops - a typo (in red). Should be: ^[^@]+@(?:[^\.]+\.){1,32}[a-z]+$ Also, when using a regular expression to validate email addresses, make sure the expression is case-insensitive. For example: if(preg_match("/regex/i", $address)) J.D.
Yes there is a way to do it. see the following tutorial on Zend http://www.zend.com/zend/spotlight/ev12apr.php
A couple of notes on checking the address online. * Some SMTP servers are configured not to report unknown users to prevent spammers from sniffing out valid email addresses. In other words, any user within their domain will be considered as a valid user and then mail will be silently discarded for bogus users; * Some SMTP servers are configured to block the IP address of those clients that fail too many times (I have seen this threshold set to as low as 1 in a couple of cases), so if you fail too many times, even you mail server may be blocked if it shares the IP address with your web server; * Some SMTP servers will immediately disconnect unless a connection is made from the port 25 (SMTP). Your client will think that the IP address is invalid and will fail the email address for no reason; * Some SMTP server will immediately try to connect to the source IP address and check if there's a valid SMTP server on the other end (some are even running a spam check) and will block the source IP address if such validation fails; Bottom line is - think twice before implementing online email address validation. J.D.
What I do to verify e-mail address (when users create new accounts and things like that): * send out an e-mail to that address with a URL with some unique ID * ask users to click on that link to 'activate' their account * NEVER allow the change of the e-mail entry in your database -- important part It's a bit more work, but you'll end up with 100% working e-mail addresses (at least at the time they register)
One more thing, when validating domain names, do not limit the the last label in the address to 3 characters. Some domains may have more - .info, .name, etc: http://www.iana.org/gtld/gtld.htm J.D.