When trying to subscribe email address that is in gmail, you get an errormessage that says email address is not valid.
This is because email validation checks if it can make a connection to www + domain in address, and gmail.com is not valid address because it only redirects you to mail.google.com
With a quick workaround to email.inc.php this can be avoided, but is there any other way to check validation to domain in email address?
Code:
function testEmailDomain($email)
{
global $test_email_by_checking_url;
if ($test_email_by_checking_url)
$handle = @fopen ("http://www.google.de/", "r");
if ($handle == false) {
// no connection - we skip the real test
return true;
} else {
// Added a support to Gmail addresses.
$domain = "" . substr(strstr($email, '@'), 1);
if ($domain == "gmail.com"){
return true;
}
// we do the test!
$domain = "http://www." . substr(strstr($email, '@'), 1);
$handle = @fopen ($domain, "r");
if ($handle == false) {
// no connection - we skip the real test
return false;
}
}
// email domain is good :)
return true;
}