net-tools/mail-checker

处理电子邮件验证的Composer库

1.0.15 2023-09-10 12:45 UTC

This package is auto-updated.

Last update: 2024-08-29 17:08:07 UTC


README

通过多个网络服务检查电子邮件存在的Composer库

安装说明

要安装net-tools/mailing包,只需通过composer要求它: require net-tools/mail-checker:^1.0.0

如何使用?

此项目使得通过多个网络服务检查电子邮件存在成为可能

// getting an API object of the desired webservice, and then creating checker object (api key and timeout as parameters)
$checker = new Checker(APIs\Bouncer::create('api_key_here', 6));

// do some checking stuff
if ( $checker->check('my_recipient@outlook.com'))
	echo "ok";
else
    echo "ko";

您还可以上传一组电子邮件地址,网络服务将对其进行处理(根据使用的API,它可能回答一个任务ID以稍后检查,无论是通过特定的API调用还是通过访问网站)

$api = APIs\Bouncer::create('api_key_here', 6);
$checker = new Checker($api);
$taskid = $checker->upload(['address1@me.com', 'otheraddress@here.com']);

// ...
// later check task processing status
if ( $api->status($taskid) )
	$json = $api->download($taskid);

支持的API有:Bouncer(需要API密钥)、EmailValidator(需要API密钥)和Trumail.io。

PHPUnit

要使用PHPUnit进行测试,将-c配置选项指向/phpunit.xml配置文件。