RE: [PHP-DB] E-mail address verification
| From: | Beau Lebens | Date: | Mon, 24 Jun 2002 02:17:19 +0000 |
| Subject: | RE: [PHP-DB] E-mail address verification | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20023@lists.php.net to get a copy of this message | ||
also, you might like to do some client-side validation before sending it to
the server, in which case you can use somehting like
http://www.dentedreality.com.au/jsvalidation/
HTH
Beau
// -----Original Message-----
// From: Gary.Every@ingramentertainment.com
// [mailto:Gary.Every@ingramentertainment.com]
// Sent: Friday, 21 June 2002 12:00 AM
// To: xbite@exonium.net; php-db@lists.php.net
// Subject: RE: [PHP-DB] E-mail address verification
//
//
//
//
//
// I do it like this:
//
//
// if
// (eregi("^[a-z0-9]+([\.%!][_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$",
// $email))
// {
// list($user, $host) = explode("@", $email);
// if ( !checkdnsrr($host, "MX") )
// return TRUE;
// }
// else
// {
// return FALSE;
// }
// }
//
// As you can see, the email can "look" right, but domain isn't
// valid. So you
// can check DNS record for MX domain.
// Next step is to connect to mail server and verify user, but
// usualy that
// takes time and it's better to send some kind of auth code to
// that mail and
// if user conforms it, you can use it...
//
// This worked very well. For any of you out there that are
// looking for a
// simple verification with host dns lookup, here it is!!!
//
// For a more comprehensive "class" check here, thanks to Manuel Lemos
//
// http://www.phpclasses.org/emailvalidation
//
//