knack/zerobounce
Composer 安装命令:
composer require knack/zerobounce
包简介
Knack Zerobounce API wrapper
README 文档
README
Knack ZeroBounce PHP API Wrapper
Installing Knack's ZeroBounce
The recommended way to install Knack's ZeroBounce is through Composer. PHP 7.2+ Required.
composer require knack/zerobounce
Example usage
Laravel
<?php use Knack\ZeroBounce\API\ZeroBounce; use Knack\ZeroBounce\Enums\StatusEnum; class EmailService { /** * @var ZeroBounce */ private $zeroBounce; /** * EmailService constructor. * * @param ZeroBounce $zeroBounce */ public function __construct(ZeroBounce $zeroBounce) { $this->zeroBounce = $zeroBounce; } /** * Validates an email address from blacklists and verifies that that domain is real. * * @param string $emailAddress * @param string $ipAddress * * @return bool */ public function isValid(string $emailAddress, string $ipAddress = ''): bool { $response = $this->zeroBounce->validate($emailAddress, $ipAddress); if($response->status === StatusEnum::VALID) { return true; } return false; } }
Vanilla PHP
<?php use Knack\ZeroBounce\API\ZeroBounce; use Knack\ZeroBounce\Enums\StatusEnum; class EmailService { /** * @var ZeroBounce */ private $zeroBounce; /** * EmailService constructor. */ public function __construct() { $this->zeroBounce = new ZeroBounce(getenv('ZEROBOUNCE_API_KEY')); } /** * Validates an email address from blacklists and verifies that that domain is real. * * @param string $emailAddress * @param string $ipAddress * * @return bool */ public function isValid(string $emailAddress, string $ipAddress = ''): bool { $response = $this->zeroBounce->validate($emailAddress, $ipAddress); if($response->status === StatusEnum::VALID) { return true; } return false; } }
Documentation
Contributing
Submitting PRs
To submit a Pull Request to this repo, just simply open up the Pull Request targeting develop.
Please ensure all tests are passing prior to submitting your Pull Request.
Running the tests
composer test
Any of the following email addresses can be used for testing the API, no credits are charged for these test email addresses:
- disposable@example.com
- invalid@example.com
- valid@example.com
- toxic@example.com
- donotmail@example.com
- spamtrap@example.com
- abuse@example.com
- unknown@example.com
- catch_all@example.com
- antispam_system@example.com
- does_not_accept_mail@example.com
- exception_occurred@example.com
- failed_smtp_connection@example.com
- failed_syntax_check@example.com
- forcible_disconnect@example.com
- global_suppression@example.com
- greylisted@example.com
- leading_period_removed@example.com
- mail_server_did_not_respond@example.com
- mail_server_temporary_error@example.com
- mailbox_quota_exceeded@example.com
- mailbox_not_found@example.com
- no_dns_entries@example.com
- possible_trap@example.com
- possible_typo@example.com
- role_based@example.com
- timeout_exceeded@example.com
- unroutable_ip_address@example.com
- free_email@example.com
You can this IP to test the GEO Location in the API.
- 99.110.204.1
knack/zerobounce 适用场景与选型建议
knack/zerobounce 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18.46k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 02 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 knack/zerobounce 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 knack/zerobounce 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 18.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: mit
- 更新时间: 2020-02-04