Verifying Emails - the reliable way
Posted: Mon Jan 26, 2004 4:38 am
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.
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.