RE: [PHP] testing an email address
| From: | Michael Geier, CDM Systems Admin | Date: | Fri, 12 Oct 2001 16:16:02 +0000 |
| Subject: | RE: [PHP] testing an email address | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70937@lists.php.net to get a copy of this message | ||
That only checks formatting...there is no absolute test for validity.
The only thing you can do is send an email to the address they supply and
force them to reply to it.
-----Original Message-----
From: Intruder [mailto:intruder@mail.lv]
Sent: Friday, October 12, 2001 11:09 AM
To: Joseph Bannon
Cc: PHP (E-mail)
Subject: Re: [PHP] testing an email address
JB> Is there a PHP function to test whether an email address is valid or
not?
There is no such a function as for PHP4.0 ;)))
But you can use this one
function validmail($email) {
if(eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,3}$", $email)) return
TRUE;
else return FALSE;
};
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net