Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Can't subscribe gmail addresses.
https://www.tinywebgallery.com/forum/viewtopic.php?f=5&t=310
Page 1 of 1

Author:  VonCede [ 15. May 2006, 16:36 ]
Post subject:  Can't subscribe gmail addresses.

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

Author:  TinyWebGallery [ 15. May 2006, 17:54 ]
Post subject: 

sure

just set
$test_email_by_checking_url=true;
to
$test_email_by_checking_url=false;

in the config or add (if you have TWG admin 0.91)

$test_email_by_checking_url=false;
to the additional tab in TWG Admin -> Configuration

/Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/