PHP library to check if an email comes from a disposable email provider.
To detect invalid emails, it provides a built-in database of 1000+ disposable email providers, but you can also use your own data.
Via Composer:
composer require mattketmo/email-checker
Basic use of EmailChecker with built-in throwaway email list:
<?php
require __DIR__.'/vendor/autoload.php';
use EmailChecker\EmailChecker;
$checker = new EmailChecker();
$checker->isValid('foo@bar.org'); // true
$checker->isValid('foo@yopmail.com'); // falseOr using a custom adapter:
<?php
use EmailChecker\EmailChecker;
use EmailChecker\Adapter;
$checker = new EmailChecker(new Adapter\ArrayAdapter(array(
'foo.org',
'baz.net'
)));
$checker->isValid('foo@bar.org'); // true
$checker->isValid('foo@baz.net'); // falseYou can build your own adapter (to use another database) simply by implementing the AdapterInterface.
This library also provides a constraint validation for your Symfony2 project:
<?php
use EmailChecker\Constraints as EmailCheckerAssert;
use Symfony\Component\Validator\Constraints as Assert;
class User
{
/**
* @Assert\NotBlank
* @EmailCheckerAssert\NotThrowawayEmail
*/
protected $email;
}- http://10minutemail.com
- http://spamdecoy.net
- http://torvpn.com/temporaryemail.html
- http://www.bloggingwv.com/big-list-of-disposable-temporary-email-services/
- http://www.fakemailgenerator.com/
- http://www.warriorforum.com/main-internet-marketing-discussion-forum/147524-list-temporary-email-services-you-may-want-block-your-autoresponder-little-rant.html
- http://xenforo.com/community/threads/ban-temporary-email-addresses.5461/
EmailChecker is released under the MIT License. See the bundled LICENSE file for details.