Re: Validation Email in PHP programs
| From: | Renze Munnik | Date: | Tue, 03 Apr 2001 13:37:40 +0000 |
| Subject: | Re: Validation Email in PHP programs | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46809@lists.php.net to get a copy of this message | ||
Johannes Janson wrote:
>
> Hi,
>
> this is the regular expression from a PHP book.
>
> ereg("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-z]{2,3})$,
> $formfield");
> looks horrible but works.
>
Besides the RE you might wanna take a look at these functions:
http://www.php.net/manual/en/function.getmxrr.php
and
http://www.php.net/manual/en/function.checkdnsrr.php
Using (one of) those you can check the email-address better. I.e.
the domain. Extract the domainname from the given email-address and
feed it to either one of these and you'll get a result whether or
not the domain has an MX-record. Only thing left is whether or not
the user exists on the given mailserver. But for as far as I know
you can't automatically check that.
--
* R&zE:
***************************
** Renze Munnik
**
** E: renze@datalink.nl
** M: +31 6 218 111 43
***************************