您好,欢迎访问一九零五行业门户网

一个低调有内涵的E-mail验证类!

这个类可以用来检查电子邮件是否有效使用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 &lt;' . $email . '&gt; exist!'; } elseif ($vmail->isvalid($email)) { echo 'email &lt;' . $email . '&gt; valid, but not exist!'; } else { echo 'email &lt;' . $email . '&gt; not valid and not exist!'; } ?> </body> </html>
其它类似信息

推荐信息