mattketmo/email-checker
Composer 安装命令:
composer require mattketmo/email-checker
包简介
Throwaway email detection library
README 文档
README
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.
Installation
Via Composer:
composer require mattketmo/email-checker
Usage
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'); // false
Or 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'); // false
You can build your own adapter (to use another database) simply by implementing the AdapterInterface.
Integration with Symfony
This library also provides a constraint validation for your Symfony project:
<?php use EmailChecker\Constraints as EmailCheckerAssert; use Symfony\Component\Validator\Constraints as Assert; class User { #[Assert\NotBlank] #[EmailCheckerAssert\NotThrowawayEmail] private string $email; }
Integration with Laravel
To integrate this library with your Laravel project add the following
line to the providers key within your config/app.php file:
EmailChecker\Laravel\EmailCheckerServiceProvider::class
If you would like to use the EmailChecker facade, you must also add the
following line to the aliases key within your config/app.php file:
'EmailChecker' => EmailChecker\Laravel\EmailCheckerFacade::class
You can then use the library within your project like so:
<?php class MyClass { public function foo() { // Facade Access EmailChecker::isValid('address@domain.com'); // Container Access $checker = app()->make('email.checker'); $checker->isValid('address@domain.com'); } public function getValidator(array $data) { // Not thow away validator return Validator::make($data, [ 'email' => 'required|email|not_throw_away' ]); } }
List of some disposable emails database
- http://10minutemail.com
- http://spamdecoy.net
- http://temp-mail.org
- 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/
License
EmailChecker is released under the MIT License. See the bundled LICENSE file for details.
mattketmo/email-checker 适用场景与选型建议
mattketmo/email-checker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.1M 次下载、GitHub Stars 达 274, 最近一次更新时间为 2013 年 03 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「email」 「check」 「throwaway」 「disposable」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mattketmo/email-checker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mattketmo/email-checker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mattketmo/email-checker 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Symfony bundle for chameleon-system/sanitycheck
This Extension integrates a credit check and more made by the LEONEX Risk Management Platform into your order process. Extensive configuration and evaluation options is provided in the Platform
SoftWax Health Check Bundle for Symfony framework
Check for holidays - localeaware
Disposable email and phone number validator
统计信息
- 总下载量: 2.1M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 283
- 点击次数: 31
- 依赖项目数: 7
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-03-18