开发者

simple way to identify the user is having the account in Gmail?

Do any one say which is the simple w开发者_开发技巧ay to identify the user is having the account in Gmail ?


Do a DNS query on the domain portion of the email address and check the MX records to see if they are the ones for Gmail. This should cover both normal Gmail addresses, as well as domains using Gmail.


You cannot automatically determine whether an arbitrary user has a Gmail account.

Instead, you can ask the user:

<input type="checkbox" name="HasGmail" />
<label for="HasGmail">Do you have a Gmail account?</label>


Why don't you ask the user to sign in with their email address and see for yourself if it's a gmail account?


Use the built-in PHP function stripos which will return False if the email address string does not contain "gmail" (all gmail email accounts, which do not use mail forwarding, contain the "gmail" string).

if (stripos($user_email_address, "gmail"))
{
    echo "We have a gmail user!";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜