Email id authentication

the mail() function

Moderators: egami, macek, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 137
Joined: Wed Aug 31, 2011 3:55 am
Location: USA

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';

Post Reply