masnathan / email-validator
This is an easy way to check if a email address is acceptable so you can avoid fake/invalid users on your database.
Fund package maintenance!
MASNathan
Requires
- php: ^7.4|^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^5.3
- vimeo/psalm: ^4.9
README
This is an easy way to check if a email address is acceptable so you can avoid fake/invalid users on your database.
What this API does is check if the email address is correctly formatted, is from a disposable or temporary service and the domain is reachable. This way you can filter out spam and one-shot accounts decreasing the rate of fake or invalid accounts on your database.
Request your API key here
Installation
You can install the package via composer:
composer require masnathan/email-validator
Usage
use MASNathan\EmailValidator\EmailValidator; $emailValidator = new EmailValidator('email-validator8.p.rapidapi.com', 'super-secret-api-key'); $details = $emailValidator->check('some-email@gmail.com'); var_dump($details); // array:5 [ // "email" => "some-email@gmail.com" // "valid" => true // "disposable" => false // "mx_records" => true // "exists" => null // ]
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.