Home > Article > Backend Development > An email verification class written in php, writing e-mail in php_PHP tutorial
This class can be used to check whether the 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.
<!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>
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.
Please take a moment to share the article with your friends or leave a comment. We will sincerely thank you for your support!