This class can be used to check if an email is valid using the SMTP protocol.
It can connect to SMTP servers defined in the MX records verified by the domain name of the address.
And simulate the delivery of a message to see if it is accepted as valid at a given recipient address.
?
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 <' . $email . '> exist!';
} elseif ($vmail->isValid($email)) {
echo 'email <' . $email . '> valid, but not exist!';
} else {
echo 'email <' . $email . '> not valid and not exist!';
}
?>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
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 <' . $email . '> exist!';
} elseif ($vmail->isValid($email)) {
echo 'email <' . $email . '> valid, but not exist!';
} else {
echo 'email <' . $email . '> not valid and not exist!';
}
?>
|
The above is all the content shared with you in this article. I hope it will be helpful to everyone to become proficient in PHP.
http://www.bkjia.com/PHPjc/973925.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/973925.htmlTechArticleAn E-mail verification class written in php. This article mainly introduces an E-mail verification class written in php. The usage is very simple and practical. If you need it, you can take it and use it directly...