Created
September 5, 2014 00:18
-
-
Save harisenbon/84af1022cc49340186f8 to your computer and use it in GitHub Desktop.
Detect if domain uses Gapps for email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Determine if this is a Google-hosted account | |
| $isGoogle = false; | |
| if(!empty($_GET['inf_field_Email'])){ | |
| list($name, $domain) = explode('@', urldecode($_GET['inf_field_Email'])); | |
| if($domain == 'gmail.com'){ | |
| $isGoogle = true; | |
| } elseif(getmxrr($domain, $mxHosts)){ | |
| foreach($mxHosts as $mx){ | |
| if(stripos($mx, 'google') !== false){ $isGoogle = true; } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment