Re: Mail Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, September 26, 2006 11:16 am, Kevin Murphy wrote:
> Why not validate the email address before you send. I use something
> like this to kick back an error that says you put in a bad email
> address. It won't tell you about a wrong email address, but it will
> tell you if they forgot to put in the @ sign and stuff.
>
> if  (!preg_match("/^(.+)@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/si", $data))
> {	$email_error = "yes";	}

Given that the *correct* PCRE expression for a valid email address is
3 pages long, the odds that yours is not rejecting some valid address
seem rather slim to me.

The . between the 9 and the - is not escaped, and renders the rest of
the characters in that class superfluous.

But let's suppose your PCRE actually proved the email syntactically
valid.

That's got *NOTHING* to do with the email generating a bounce or not!

There are a zillion times as many syntactically valid emails as there
are ones that don't bounce, never mind the even smaller class of email
addresses that actually go somewhere, and the even smaller class of
email addresses that a human reads on a regular basis.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux