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

How to send emails in PHP using pear's own mail class library, pear class library_PHP tutorial How to send emails in PHP using pear's own mail class library, pear class library_PHP tutorial

13 Jul 2016

PHP uses the mail class library that comes with pear to send emails, the pear class library. PHP uses the mail class library that comes with pear to send emails. The pear class library This article describes how PHP uses the mail class library that comes with pear to send emails. Share it with everyone for your reference. Details are as follows

Python server programming: Use Mail service library to implement email push Python server programming: Use Mail service library to implement email push

18 Jun 2023

Python is a high-level programming language that can be used to write a variety of applications and systems. Python also plays an important role in server programming. This article will introduce how to use Python's Mail service library to implement email push. What is the Mail service library? The Mail service library is Python's built-in email sending tool library, which provides functions for sending emails and reading emails. Mail push can be easily implemented through the Mail service library. How to send mail using Mail service library? we can

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

13 Jul 2016

An E-mail verification class written in php, and e-mail written in php. 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 be connected to an MX record verified by the domain name of the address

PHP email sending class PHP email sending class

28 Jul 2016

: PHP mail sending class: Mail sending class obtained from ThinkPHP, collect it

Simple use of PHP mail class library PHPMailer_PHP tutorial Simple use of PHP mail class library PHPMailer_PHP tutorial

13 Jul 2016

Simple use of PHP mail class library PHPMailer. Recently I need to use the function of sending emails, which was originally sent using the mail() function that comes with PHP. The php mail() method is very simple, convenient and easy to use, but in addition to NetEase mailbox, QQ mailbox,

Analysis on CodeIgniter framework verification code library files and usage Analysis on CodeIgniter framework verification code library files and usage

14 Jun 2018

This article mainly introduces the CodeIgniter framework verification code class library file and usage, and analyzes the definition and specific usage of the CodeIgniter framework verification code class library file in the form of examples. It has certain reference value. Friends in need can refer to it.

See all articles