这个类可以用来检查电子邮件是否有效使用smtp协议。
它可以连接到由地址的域名来验证的mx记录中定义的smtp服务器。
并且模拟消息的传递,以查看是否在给定的收件人地址被接受为有效。
1.代码
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sample</title>
</head>
<body>
<?php
//www.codepearl.com
include_once 'class.verifyEmail.php';
$email = 'verify@codepearl.com';
$vmail = new verifyEmail();
if ($vmail->check($email)) {
echo 'email <' . $email . '> exist!';
} elseif ($vmail->isValid($email)) {
echo 'email <' . $email . '> valid, but not exist!';
} else {
echo 'email <' . $email . '> not valid and not exist!';
}
?>
</body>
</html>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号