how ever i don't think most ISPs let users pick names with the + sign in it
----- Original Message -----
From: "Paul Chvostek" <[EMAIL PROTECTED]>
To: "David E.S.V." <[EMAIL PROTECTED]>
Cc: "Philip J. Newman" <[EMAIL PROTECTED]>; <php- [EMAIL PROTECTED]>
Sent: Wednesday, March 12, 2003 2:37 PM
Subject: Re: [PHP] Checking for a Valid Email String.
(eregi("^[0-9a-z]([-_.]?[0-9a-z])[EMAIL PROTECTED]([-.]?[0-9a-z])*\\.[a- z]{2,3}$",> On Wed, 12 Mar 2003, Philip J. Newman wrote: > > > Required: Help for checking for a valid email string.
On Tue, Mar 11, 2003 at 08:19:36PM -0500, David E.S.V. wrote: > > you mean something like this? > > //checking if the email is valid > > if
$email, $check))$validate_email_temp) )> { > if ( !getmxrr(substr(strstr($check[0], '@'), 1),(!eregi('[a-z0-9][a-z0-9._=+-]*@([a-z0-9][a-z0-9-]*\.)+[a-z][a- z]+$',$what))> $mensaje="server not valid"; > > // checking DNS > if(!checkdnsrr(substr(strstr($check[0], '@'), 1),"ANY")) > $mensaje="server not valid"; > > }
Don't forget plus signs. When providing email addresses to lists and web sites, I regularly tag my address (as the From address on this message demonstrates). Using procmail for local delivery allows these addresses to be delivered to my account, and I can more easily track down the origin of "tagged" spam. When I come across a web site or list that doesn't allow my address with a plus sign, I find another site or list. So I use:
function isvalidemail($what) { if
return(false);list($user,$domain) = explode("@",$what); if (!getmxrr($domain,$mxhosts)) return(false); if (!count($mxhosts) > 0) return(false); return(true); }
-- Paul Chvostek <[EMAIL PROTECTED]> Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/
What about those of us who run our own mailservers? A plus sign is a valid character in an email address. Doesn't matter if places like AOL don't let their users put it in their user's email addresses. There's no point in *not* allowing it, since it *is* a valid character.
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php