Connecting Tech Pros Worldwide Forums | Help | Site Map

Email Verification

Newbie
 
Join Date: Sep 2007
Posts: 9
#1: Jan 18 '08
Can any one help me?
how to verify weather the Email actually exist or not?
Thanks in Advance.

dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,095
#2: Jan 18 '08

re: Email Verification


Quote:

Originally Posted by shalinikonatam

Can any one help me?
how to verify weather the Email actually exist or not?
Thanks in Advance.

there's no code that allows you to do this, otherwise spammers would have a field day.

did you google this question? no?


http://www.dailysofts.com/program/92..._Software.html

cuz i found that, along with 20 questions posted.


[PHP]
function google($yourQ)
{
if ($yourAnswer == NULL)
{
echo "Help! no answer on google";
}
else
{
$you = $bangHeader->Table * 100;
return $you;
}

}
[/PHP]
google("Email Verification Exists");
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,949
#3: Jan 18 '08

re: Email Verification


Quote:

Originally Posted by dlite922

there's no code that allows you to do this, otherwise spammers would have a field day.

did you google this question? no?


http://www.dailysofts.com/program/92..._Software.html

cuz i found that, along with 20 questions posted.


[PHP]
function google($yourQ)
{
if ($yourAnswer == NULL)
{
echo "Help! no answer on google";
}
else
{
$you = $bangHeader->Table * 100;
return $you;
}

}
[/PHP]
google("Email Verification Exists");

HAHA!

I'm so saving that; use it on a newbie caught in the headlights :D

To the OP:

The best way to validate an email is using a regex (regular expression)

There are soooo many tutorials on the world wide internets, so a simple google search (no headbanging required) will suffice!

Here's a validation i use:
[php]
function validateEmail(){
global $__errorEmail;
$email = $_POST['email'];
$__emailExp = '/^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$/';

if(!preg_match($__emailExp, $email)){
$__errorEmail = "Invalid Email - Please re-enter.";
} else {
return true;
}
}
if(validateEmail()){
echo "email is valid";
} else {
echo "Come again";
}
[/php]

:)
[/php]
nathj's Avatar
Expert
 
Join Date: May 2007
Location: North Tyneside
Posts: 857
#4: Jan 18 '08

re: Email Verification


Quote:

Originally Posted by markusn00b

HAHA!

I'm so saving that; use it on a newbie caught in the headlights :D

To the OP:

The best way to validate an email is using a regex (regular expression)

There are soooo many tutorials on the world wide internets, so a simple google search (no headbanging required) will suffice!

Here's a validation i use:
[php]
function validateEmail(){
global $__errorEmail;
$email = $_POST['email'];
$__emailExp = '/^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$/';

if(!preg_match($__emailExp, $email)){
$__errorEmail = "Invalid Email - Please re-enter.";
} else {
return true;
}
}
if(validateEmail()){
echo "email is valid";
} else {
echo "Come again";
}
[/php]

:)
[/php]

Hi,

Tthis is pretty much what I do for email verification. the draw back with this is that is simply checks that the user entered value s in the correct format to be an email address.

If you then send an email to that address using PHP you can checkt the return of mail() and if this is true it was able to send themail so you can call it good. If it is false then the chances are the email is bad and so you can take steps to remove it from the list.

I admit thisis not foolproof but it does give you a further option for attempting keep your email list clean. You can of course allow for tolerance to say if the email fails 5 times then remove it. This is a bitmore advaced and you'd need to check the database for each email address as you send the email out.

I hope this makes sense and I wish you luck with the project.

Cheers
nathj
ak1dnar's Avatar
Moderator
 
Join Date: Jan 2007
Location: Colombo
Posts: 1,440
#5: Jan 19 '08

re: Email Verification


Guys, try this one too.
http://www.php.net/checkdnsrr
Reply