JBZoo\Utils\Email::checkDns PHP Method

checkDns() public static method

Check for DNS MX records of the email domain. Notice that a (temporary) DNS error will have the same result as no records were found. Code coverage ignored because this method requires DNS requests that could not be reliable.
public static checkDns ( string $email ) : boolean
$email string
return boolean
    public static function checkDns($email)
    {
        if (!self::_isValid($email)) {
            return false;
        }
        $domain = self::_extractDomain($email);
        if (checkdnsrr($domain, "MX") === false) {
            return false;
        }
        return true;
    }