dev-master
9999999-dev https://github.com/rottingham/EmailValidatorValidate Email Address and use SMTP Lookup to verify MX Record lookups
MIT
The Requires
- php >=5.0
email url validate format smtp mxrecord
Wallogit.com
2017 © Pedro Peláez
Validate Email Address and use SMTP Lookup to verify MX Record lookups
Utility Class to validate Email address string as well as determine if the Email inbox exists on the mail server by using an SMTP lookup., (*1)
For extended usage examples, see test files., (*2)
Composer Ready, (*3)
Available on Packagist: https://packagist.org/packages/rottingham/emailvalidator, (*4)
Simply import the Emailvalidator.class.php file into your project if you are not using dependency injection., (*5)
require __DIR__ . '/src/com/rottingham/EmailValidator/EmailValidator.class.php';
To validate an Email string, use the EmailValidator::validate(email) method;, (*6)
$email = 'imlegit@google.com'; $isValid = EmailValidator\EmailValidator::validate($email); var_dump($isValid);
To determine if the Emai actaully exists on the mail server, use the EmailValidator::exists(email) method;, (*7)
$email = 'imlegit@yahoo.com'; $exists = EmailValidator\EmailValidator::exists($email); var_dump($exists);
Note: EmailValidator::exists(url) calls EmailValidator\SmtpLookup\SmtpLookup::lookup(email) and requests from the mail server whether or not the address book record exists. This could fail if your IP address and/or mail server have been blacklisted., (*8)
You can use the EmailValidator\SmtpLookup.class.php class seperately by importing it into your project., (*9)
require __DIR__ . '/src/com/rottingham/SmtpLookup/SmtpLookup.class.php';
Validate Email Address and use SMTP Lookup to verify MX Record lookups
MIT
email url validate format smtp mxrecord