Re: verify that email exist ?

From: Date: Wed, 31 Jan 2001 02:45:47 +0000
Subject: Re: verify that email exist ?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-37390@lists.php.net to get a copy of this message
It's nearly impossible to validate an e-mail address as completely valid. The example given by Mr. Clark is very in-depth and well done. If you are looking for something a little simpler here's a snippet of code that checks to see if the format of the email address is valid meaning it contains x characters, then an @ followed by x character . x characters. I use this function for my message board to at least validate the e-mail address the user submits is at least partially correct: in your main routine just make this call emailcheck($email); function emailcheck($email) { $valid = ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$", $email, $trashed); if($valid) { $ismatch = "Yes"; } else { $ismatch = "No"; echo "The e-mail address you entered, $email, appears to be invalid\n"; echo "Please enter a valid e-mail address and resubmit."; exit; } } I use $ismatch for other purposes but can be omitted and the function can be changed to simply if(!$valid) Hope that helps some. Chad Guilette ----- Original Message ----- From: "Brian Clark" <brianj@fusionwerks.com> To: "PHP is not a drug ." <php-general@lists.php.net> Sent: Tuesday, January 30, 2001 6:38 AM Subject: Re: [PHP] verify that email exist ? > > Hello Website4S, > > (Wac == "Website4S@aol.com") Website4S@aol.com etched: > > Wac> I don`t think it is possible to check that an email actually > Wac> exists but what > > It's possible: > > http://phpclasses.upperdesign.com/browse.html/package/13 > > Class that may be used to determine if a given e-mail address > is valid. > > It features: > > - Simple validation just by looking at the e-mail address string. > - Validation of a e-mail address host as a valid mail exchange domain. > - Validation of a e-mail address by connecting to the mail host > server to determine if there is really a deliverable mail box. > > -Brian > -- > Dinner not ready: (A)bort (R)etry (P)izza > > > > -- > 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 > > > >

« previous php.general (#37390) next »