Home  >  Article  >  Backend Development  >  An email verification class written in php, writing e-mail in php_PHP tutorial

An email verification class written in php, writing e-mail in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:00:351182browse

An E-mail verification class written in php, e-mail written in php

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>
    <&#63;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!';
    }
    &#63;>
  </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!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/973284.htmlTechArticleAn E-mail verification class written in php, e-mail written in php. This class can be used to check whether the email is Use the SMTP protocol effectively. It can be connected to an MX record verified by the domain name of the address...
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