Home PHP Libraries Mail class library PHP 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 tutorial PHP PDO common class library example analysis, pdo class library example analysis_PHP tutorial

12 Jul 2016

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

How to solve PHP email management problem? It can be done easily using the php-imap/php-imap library! How to solve PHP email management problem? It can be done easily using the php-imap/php-imap library!

17 Apr 2025

I encountered a tough problem when developing a project that needs to process mail: how to efficiently manage mailboxes, get and delete mail. After trying multiple methods, I found that the php-imap/php-imap library not only solves my problem, but also greatly improves the efficiency and stability of the program.

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

12 Jul 2016

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.

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

17 Oct 2024

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

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

22 Oct 2024

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

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

12 Jul 2016

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.

See all articles