Skip to content

Instantly share code, notes, and snippets.

@privatehosting
Created April 25, 2014 00:25
Show Gist options
  • Save privatehosting/11274096 to your computer and use it in GitHub Desktop.
Save privatehosting/11274096 to your computer and use it in GitHub Desktop.
Nachfrage ob eMail Adresse Valide ist und ob der Mail Server auch in der Domain Eingetragen wurde.
<?php
function IsValideEmail($email)
{
//$email = strtolower($email); ;; Groß und Kleinschreibung wird im eMail Verkehr berücksichtigt.
$return = false;
if(filter_var($email, FILTER_VALIDATE_EMAIL))
{
list($user, $host) = explode("@", $email);
if(checkdnsrr($host, "A") && checkdnsrr($host, "MX"))
{
$return = true;
}
}
return $return;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment