Re: What this means "(\w|-)+@\w"? [message #175001 is a reply to message #174998] |
Tue, 02 August 2011 12:56 |
Peter H. Coffin
Messages: 245 Registered: September 2010
Karma:
|
Senior Member |
|
|
On Tue, 02 Aug 2011 11:50:09 +0200, ?lvaro G. Vicario wrote:
> El 02/08/2011 10:06, Sandman escribi?/wrote:
>> What's wrong with the PHP built in email validator?
>>
>> <?
>> if (filter_var($email, FILTER_VALIDATE_EMAIL)){
>> # Do fancy stuff, such as sending fancy email!
>> }
>> ?>
>
> For instance:
>
> var_dump(filter_var('webmaster@?lvaro.es', FILTER_VALIDATE_EMAIL));
> var_dump(filter_var('webmaster(at)asxn--lvaro-wqa(dot)es', FILTER_VALIDATE_EMAIL));
>
> bool(false)
> bool(false)
Several years ago, I wrote an email validator that worked fairly will,
and handled address cases that hadn't even been thought of yet. It used
telnet to fake being a MTA to the MX of record for the domain through
enough steps to ask if the receiving MTA would actually accept mail for
the address, but stopping short of actually sending anything.
It was, however, really slow, to start up. Once it had everything cached
up, it could average a couple of email addresses being validated per
second, but the first few hundred took a half hour or so.
I wonder what happened to that code....
--
The plural of datum is not "facts".
A collection of facts is not "knowledge".
|
|
|