golffor1
07-21-2012, 04:38 AM
function checkEmail($email)
{
//check email format
if (filter_var($email, FILTER_VALIDATE_EMAIL) == $email){
//check if the domain has MX entries
$aux = explode('@',$email);
return checkdnsrr($aux[1],'MX');
}
return false;
}
$email = $_POST['emailAddress'];
//don't worry I am grabbing the e-mail address from a form and can display it
$var = checkEmail($variable);
if (checkEmail($var) == "true")
{
"true";
}
else
{
echo "false";
}
I am using the e-mail address of this@yahoo.com and that returns false
and using the e-mail address of aaa@aaa.com
{
//check email format
if (filter_var($email, FILTER_VALIDATE_EMAIL) == $email){
//check if the domain has MX entries
$aux = explode('@',$email);
return checkdnsrr($aux[1],'MX');
}
return false;
}
$email = $_POST['emailAddress'];
//don't worry I am grabbing the e-mail address from a form and can display it
$var = checkEmail($variable);
if (checkEmail($var) == "true")
{
"true";
}
else
{
echo "false";
}
I am using the e-mail address of this@yahoo.com and that returns false
and using the e-mail address of aaa@aaa.com