php编写的一个E-mail验证类_PHP教程

WBOY
Release: 2016-07-13 10:00:15
Original
1215 people have browsed it

php编写的一个E-mail验证类

 这篇文章主要介绍了php编写的一个E-mail验证类的用法,非常的简单实用,需要的小伙伴参考下,可以直接拿走使用。

 

 

这个类可以用来检查电子邮件是否有效使用SMTP协议。

它可以连接到由地址的域名来验证的MX记录中定义的SMTP服务器。

并且模拟消息的传递,以查看是否在给定的收件人地址被接受为有效。

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

Sample

//www.codepearl.com

include_once 'class.verifyEmail.php';

 

$email = 'verify@codepearl.com';

 

$vmail = new verifyEmail();

 

if ($vmail->check($email)) {

echo 'email exist!';

} elseif ($vmail->isValid($email)) {

echo 'email valid, but not exist!';

} else {

echo 'email not valid and not exist!';

}

?>

以上所述就是本文给大家分享的全部内容了,希望对大家熟练掌握PHP能够有所帮助。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/973925.htmlTechArticlephp编写的一个E-mail验证类 这篇文章主要介绍了php编写的一个E-mail验证类的用法,非常的简单实用,需要的小伙伴参考下,可以直接拿走使用...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!