Home  >  Article  >  php教程  >  一个低调有内涵的E-mail验证类!

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

PHP中文网
PHP中文网Original
2016-05-20 12:56:331572browse

这个类可以用来检查电子邮件是否有效使用SMTP协议。
它可以连接到由地址的域名来验证的MX记录中定义的SMTP服务器。
并且模拟消息的传递,以查看是否在给定的收件人地址被接受为有效。

1.代码



    
        
        Sample
    
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!'; } ?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn