If you need to be absolutely sure that an email is correct and working - I've just come across this script:
http://www.weberdev.com/get_example.php3/1238
It does the following:
/* This function takes in an email address (say 'shane@tuna.org')
* and tests to see if it's a valid email address.
*
* An array with the results is passed back to the caller.
*
* Possible result codes for the array items are:
*
* Item 0: [true|false] true for valid email address
* false for NON-valid email address
*
* Item 1: [SMTP Code] if a valid MX mail server found, then
* fill this array in with failed SMTP
* reply codes
*
* Item 2: [true|false] true for valid mail server found for
* host/domain
* false if no valid mail server found
*
* Item 3: [MX server] if a valid MX host was found and
* connected to then fill in this item
* with the MX server hostname
*
* EXAMPLE code for use is at the very end of this function.
*/
Neat.
Verifying Emails - the reliable way
Moderator: General Moderators
-
markbeadle
- Forum Commoner
- Posts: 29
- Joined: Tue Dec 02, 2003 2:50 am
- Location: Aachen, Germany
that's why i'm not gong to run out and get that. i have one that checks all top levels (thank you genik for a link that has all the 3+ letter top levels) and uses \w\w to check two letter country codes for the final bit, and then checks format for the rest (i'll drop in the preg call if anyone wants) and then the user has to return to the site via a link to sign up. thus validating the email.Weirdan wrote:Perhaps the best verification is the user writing from that address
Here's the regex writting in perl (conform with rfc822) http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html