Skip to content

Instantly share code, notes, and snippets.

@bobpattersonjr
Created September 14, 2012 02:11
Show Gist options
  • Save bobpattersonjr/3719387 to your computer and use it in GitHub Desktop.
Save bobpattersonjr/3719387 to your computer and use it in GitHub Desktop.
Check Email Domain
function checkEmailDomain($email) {
if(preg_match('/^([a-zA-Z0-9_])+([a-zA-Z0-9\.+_-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/', $email)){
list($username,$domain)=split('@',$email);
if(!checkdnsrr($domain,'MX')) {
return false;
}
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment