/** * Exists * * Uses SMTP/MX Query Requests to check whether or not the Email * address exists on the server. * * **This requires an active, open net connection** * **This could fail if your outbound IP/mail server has been blacklisted** * * @param string $email Email address to discover * @return Returns TRUE if the server response verifies the Email address. * FALSE otherwise. */ public static function exists($email) { if (!EmailValidator::validate($email)) { return false; } $smtp = new SmtpLookup\SmtpLookup(); return $smtp->lookup($email); }
<?php require __DIR__ . '/../SmtpLookup/SmtpLookup.class.php'; use EmailValidator\SmtpLookup; $email = '*****@*****.**'; $smtp = new SmtpLookup\SmtpLookup(); var_dump($smtp->lookup($email));