Identify the invalid email addresses

the mail() function

Moderators: macek, egami, gesf

brroopa
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Dec 26, 2002 3:23 am

Identify the invalid email addresses

Postby brroopa » Thu Jan 02, 2003 11:29 pm

Problem is that, to identify the invalid email addresses (i have an email table in db with the coloumns email addresses and status). If the user enters invalid email address, that particular account has to be flaged(status=0). How to do this in php?

Help is appreciated
Thanx

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Fri Jan 03, 2003 12:29 am

with regular expresions...

allowed chars in email is here RFC 821
somewhare here i post email verification script you can find at this forum if you want...

brroopa
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Dec 26, 2002 3:23 am

Postby brroopa » Fri Jan 03, 2003 2:31 am

Pejone wrote:with regular expresions...

allowed chars in email is here RFC 821
somewhare here i post email verification script you can find at this forum if you want...



Sorry, i am not clear with that. I searched for the email verification script in this forum, but couldn't find it. If possible can you please send the code snippet/example for this

Thanx

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Fri Jan 03, 2003 3:04 am

one minute sciptig and you get simple mail validator =)
this basics, regexp can be dificult =)

Code: Select all

<?
$mail = $HTTP_POST_VARS["mail"];
if (!eregi("[a-z]+@[a-z]+\.[a-z]{2,3}", $mail)) {
onError("mail");
exit;
}
?>


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest