search
HomePHP LibrariesMail class libraryPHP email verification library
PHP email verification library
<?php
class HasMxTest extends PHPUnit_Framework_TestCase
{
    /**
     * Set up for tests in this file.
     *
     * @access private
     */
    private function setupTest()
    {
        $this->validator = new \EmailValidator\Validator();
    }
    /**
     * Test hasMx
     *
     * @cover \EmailValidator\Validator::hasMx
     */
    public function testHasMx()
    {
        $this->setupTest();
        // Not an email
        $this->assertNull(
            $this->validator->hasMx('example.com')
        );
        // No Records
        $this->assertFalse(
            $this->validator->hasMx('example@example.com')
        );
        // Records
        $this->assertTrue(
            $this->validator->hasMx('example@google.com')
        );
        $this->assertTrue(
            $this->validator->hasMx('example@yahoo.com')
        );
    }
}

This is a PHP email verification library, friends who need it can download and use

Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

PHP PDO common class library example analysis, pdo class library example analysis_PHP tutorialPHP PDO common class library example analysis, pdo class library example analysis_PHP tutorial

12Jul2016

PHP PDO common class library example analysis, pdo class library example analysis. Example analysis of PHP's PDO common class library, pdo class library example analysis This article describes PHP's PDO common class library with examples. Share it with everyone for your reference, the details are as follows: 1. Db.class.php connects to the database

PHP uses the Mysqli class library to achieve perfect paging effect, mysqli class library_PHP tutorialPHP uses the Mysqli class library to achieve perfect paging effect, mysqli class library_PHP tutorial

12Jul2016

PHP uses the Mysqli class library to achieve perfect paging effects, the mysqli class library. How PHP uses the Mysqli class library to achieve perfect paging effects, mysqli class library This article describes how PHP uses the Mysqli class library to achieve perfect paging effects. Share it with everyone for your reference.

PHP email verification example tutorial, php email example_PHP tutorialPHP email verification example tutorial, php email example_PHP tutorial

12Jul2016

PHP email verification example tutorial, php email example. PHP email verification example tutorial, php email example One of the most common security verifications in user registration is email verification. According to common industry practice, email verification is required to avoid potential security risks.

How to Troubleshoot Email Delivery Issues with PHP Mail() and PHPMailer?How to Troubleshoot Email Delivery Issues with PHP Mail() and PHPMailer?

22Oct2024

This article provides debugging solutions for issues encountered when using PHP mail() or PHPMailer to send emails. It addresses errors related to the mail() function and the missing PHPMailer class import. The article suggests enabling SMTP debuggin

What is the Most Effortless PHP Library for Form Validation?What is the Most Effortless PHP Library for Form Validation?

17Oct2024

Easiest Form Validation Library for PHPIn search of a straightforward PHP library that simplifies form validation tasks? Let's explore your options:Custom Library ExampleThe user suggests a custom PHP class that incorporates predefined regex patterns

What\'s the Easiest Form Validation Library in PHP for Programmers?What\'s the Easiest Form Validation Library in PHP for Programmers?

17Oct2024

Easiest Form Validation Library for PHPProblem:Developing a straightforward PHP library for efficient form validation, where rules and field names can be easily passed and errors retrieved.Answer:One approach is to implement your own validation class

See all articles