PHP的邮箱验证库
<?php class HasMxTest extends PHPUnit_Framework_TestCase { /** * Set up for tests in this file. * * @access private */ private function setupTest() { $this->validator = new \EmailValidator\Validator(); } /** * Test hasMx * * @cover \EmailValidator\Validator::hasMx */ public function testHasMx() { $this->setupTest(); // Not an email $this->assertNull( $this->validator->hasMx('example.com') ); // No Records $this->assertFalse( $this->validator->hasMx('example@example.com') ); // Records $this->assertTrue( $this->validator->hasMx('example@google.com') ); $this->assertTrue( $this->validator->hasMx('example@yahoo.com') ); } }
这是一份PHP的邮箱验证库,需要的朋友可以下载使用
免责声明
本站所有资源均由网友贡献或各大下载网站转载。请自行检查软件的完整性!本站所有资源仅供学习参考。请不要将它们用于商业目的。否则,一切后果由您负责!如有侵权,请联系我们删除。联系方式:admin@php.cn
相关文章
如何验证从 PHP 发送的 SMTP 邮件?
29Nov2024
使用 PHP 邮件进行 SMTP 身份验证 从 PHP 发送出站 SMTP 邮件可能需要身份验证,特别是对于强制要求...的 ISP 帐户
如何在GitLab中去掉账户添加时的邮箱验证程序
10Apr2023
随着科技的不断发展,人们在工作中越来越多地依赖于互联网和计算机软件。在软件开发领域中,GitLab是一种非常流行的代码托管平台。GitLab管理员负责管理GitLab账户,包括添加新账户和修改现有账户的权限。在添加新账户时,GitLab通常会要求输入电子邮件地址进行验证。然而,有时管理员需要在不验证电子邮件地址的情况下添加新账户。本篇文章将介绍如何在GitLab中去掉账户添加时
如何使用 php.ini 和外部库在 PHP 中验证 SMTP 邮件?
28Nov2024
使用 php.ini 进行 SMTP 身份验证许多 ISP 要求通过用户名和密码对出站 SMTP 邮件进行身份验证。虽然 php.ini 允许...
Hot Tools
热门文章
崩坏:星穹铁道 - 所有金色替罪羊谜题解决方案
18Jan2025手游攻略
Tales Of Graces F 重制版:所有锁定的宝箱密码
18Jan2025手游攻略
如何修复 KB5049622 在 Windows 11 中安装失败的问题?
15Jan2025故障排查
Haikyuu Legends 风格指南:完整列表和最佳选择
25Jan2025手游攻略
如何修复 KB5050021 在 Windows 11 中安装失败的问题?
15Jan2025故障排查