Email id authentication

the mail() function

Moderators: macek, egami, gesf

vinodhini
New php-forum User
New php-forum User
Posts: 1
Joined: Sun Jul 24, 2011 11:37 pm

Email id authentication

Postby vinodhini » Sun Jul 24, 2011 11:51 pm

Dear All,

My requirement is how to check the authenticity of the email id given by the user.

The process of checking should happen as soon as they enter their email id in the application.
If it is a valid & authenticated email id, the user should be allowed to proceed further with registration, if not he should be notified to enter a valid email id. This will help us in avoiding hundreds of mails bouncing back from invalid email ids.

Kindly help me with PHP coding for the above-mentioned requirement

Thank you.

User avatar
bigjoe11a
New php-forum User
New php-forum User
Posts: 128
Joined: Wed Aug 31, 2011 3:55 am
Location: USA
Contact:

Re: Email id authentication

Postby bigjoe11a » Tue Sep 27, 2011 7:54 pm

vinodhini wrote:Dear All,

My requirement is how to check the authenticity of the email id given by the user.

The process of checking should happen as soon as they enter their email id in the application.
If it is a valid & authenticated email id, the user should be allowed to proceed further with registration, if not he should be notified to enter a valid email id. This will help us in avoiding hundreds of mails bouncing back from invalid email ids.

Kindly help me with PHP coding for the above-mentioned requirement

Thank you.


Try this

Code: Select all

function check_email($email){
 
if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
return true;
} else {
return false;
}
} // ends function

$isReal = check_email($email);
If(!isReal) {
echo 'Your email address is not valid';
exit;
}


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest