ddtraceweb/smtp-validator-email
Composer 安装命令:
composer require ddtraceweb/smtp-validator-email
包简介
Validate your email by smtp protocol
README 文档
README
- Smtp Validator mail can validate your email to send smtp mail and check your mx.
#Requirements
- PHP >= 5.4
- namespaces use
- smtp configuration PHP Ok.
#Installation For installation you can use composer.
Simple add "ddtraceweb/smtp-validator-email": "dev-master"
in your composer.json to install the latest version
#examples :
- example with 1 email :
<?php use SmtpValidatorEmail\ValidatorEmail; $from = 'xyz@xzzz.com'; // for SMTP FROM:<> command $emails = 'toto@somewhererlse.com'; $validator = new ValidatorEmail($email, $from); var_dump($validator->getResults()); ?>
- example with X emails :
<?php use SmtpValidatorEmail\ValidatorEmail; $from = 'xyz@xzzz.com'; // for SMTP FROM:<> command $emails = array('toto@somewhererlse.com', 'titi@totitito.com'); $validator = new ValidatorEmail($email, $from); var_dump($validator->getResults()); ?>
- example with X emails and have custom delays time when connection and send HELO, with domain need time to respond.
<?php use SmtpValidatorEmail\ValidatorEmail; $from = 'xyz@xzzz.com'; // for SMTP FROM:<> command $emails = array('toto@somewhererlse.com', 'titi@totitito.com'); //two loops in this example for difficult domains. $options = array('delaySleep' => array(0, 6)); //Handle $options to the constructor as third parameter $validator = new ValidatorEmail($email, $from, $options); var_dump($validator->getResults()); ?>
- example with X emails with more informations on domain, mxs and priorities.
<?php use SmtpValidatorEmail\ValidatorEmail; $from = 'xyz@xzzz.com'; // for SMTP FROM:<> command $emails = array('toto@somewhererlse.com', 'titi@totitito.com'); //more informations option activate $options = array('domainMoreInfo' => true); //Handle $options to the constructor as third parameter $validator = new ValidatorEmail($email, $from, $options); var_dump($validator->getResults()); ?>
- example with X emails with more informations on domain, mxs and priorities. In example same domain for two email. This is a connection to domain and check all account emails.
<?php use SmtpValidatorEmail\ValidatorEmail; $from = 'xyz@xzzz.com'; // for SMTP FROM:<> command $emails = array('toto@somewhererlse.com', 'titi@somewhererlse.com'); //more informations option activate $options = array('domainMoreInfo' => true); //Handle $options to the constructor as third parameter $validator = new ValidatorEmail($email, $from, $options); var_dump($validator->getResults()); ?>
- example with 1 email with using a specific interface with debug mode ON:
<?php use SmtpValidatorEmail\ValidatorEmail; $from = 'xyz@xzzz.com'; // for SMTP FROM:<> command $emails = 'toto@somewhererlse.com'; $validator = new ValidatorEmail($email, $from, array('debug' => true, 'context' => 'socket' => array('bindto' => '0.0.0.0'))); var_dump($validator->getResults()); var_dump($validator->getDebug()); ?>
- Available default options
array( 'domainMoreInfo' => false, 'delaySleep' => array(0), 'noCommIsValid' => 0, 'catchAllIsValid' => 0, 'catchAllEnabled' => 1, 'timeout' => null, // ini_get("default_socket_timeout") 'context' => array(), 'detailResults' => false, // Instead of returning 0 for invalid and 1 for valid, it will return an array. array('result' => $isValid /* 0 or 1 */, 'info' => "<SMTP response like: 250 2.1.5 Ok>") 'debug' => false );
ddtraceweb/smtp-validator-email 适用场景与选型建议
ddtraceweb/smtp-validator-email 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 146.05k 次下载、GitHub Stars 达 28, 最近一次更新时间为 2013 年 07 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「validator email」 「smtp validator email」 「checkmx」 「validate email」 「check email smtp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ddtraceweb/smtp-validator-email 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ddtraceweb/smtp-validator-email 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ddtraceweb/smtp-validator-email 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Runn Me! Validation and Sanitization Library
Extension for Opis JSON Schema
Extensible library for building notifications and sending them via different delivery channels.
The Message Submission Agent Diagnostics tool (msadiag) facilitates testing the compatibility of third party message submission agents.
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
Laravel credit card validator 2 from rap2hpoutre
统计信息
- 总下载量: 146.05k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 31
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-07-31