devmastersbv/smtp-validate-email
Composer 安装命令:
composer require devmastersbv/smtp-validate-email
包简介
Validates an email address by checking for MX records and performing and SMTP triplet connection
关键字:
README 文档
README
Perform email address validation/verification via SMTP.
The class retrieves MX records for the email domain and then connects to the domain's SMTP server to try figuring out if the address really exists.
Some features (see the source for more)
- Not really sending a message, gracefully resetting the session when done
- Command-specific communication timeouts implemented per relevant RFCs
- Catch-all account detection
- Batch mode processing supported
- MX query support on Windows without requiring any PEAR packages
- Logging and debugging support
Basic example
<?php use SMTPValidateEmail\SMTPValidateEmail; $from = 'sendingemail@test.test'; $email = 'emailtoverify@test.test'; $validator = new SMTPValidateEmail($email, $from); $smtp_results = $validator->validate(); print_r($smtp_results);
Array usage
The class supports passing an array of addresses in the constructor or to the
validate() method. Checking multiple addresses on the same server uses
a single connection.
<?php use SMTPValidateEmail\SMTPValidateEmail; $from = 'a-happy-camper@campspot.net'; // for SMTP FROM:<> command $emails = array( 'someone@somewhere.net', 'some-other@somewhere-else.net', 'someone@example.com', 'someone-else@example.com' ); $validator = new SMTPValidateEmail($emails, $from); $smtp_results = $validator->validate(); // or passing to the validate() method // $validator = new SMTPValidateEmail(); // $smtp_results = $validator->validate($emails, $from); print_r($smtp_results);
统计信息
- 总下载量: 946
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2017-01-13