Reputation: 1113
Do any one say which is the simple way to identify the user is having the account in Gmail ?
Upvotes: 0
Views: 161
Reputation: 5432
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!";
}
Upvotes: 0
Reputation: 29170
Why don't you ask the user to sign in with their email address and see for yourself if it's a gmail account?
Upvotes: 1
Reputation: 2941
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.
Upvotes: 3
Reputation: 888087
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>
Upvotes: 1