PHPackages                             peoplefone/mail-validator-mx-server - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. peoplefone/mail-validator-mx-server

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

peoplefone/mail-validator-mx-server
===================================

Validate e-mail addresses by connecting to the remote MX server.

v1.0.2(7y ago)122MITPHPPHP &gt;=5.3.0

Since Mar 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/peoplefone/mail-validator-mx-server)[ Packagist](https://packagist.org/packages/peoplefone/mail-validator-mx-server)[ RSS](/packages/peoplefone-mail-validator-mx-server/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Mail Validator by MX
====================

[](#mail-validator-by-mx)

This package allows you to define e-mail addresses to verify them via the corresponding remote MX server.

The validation returns an array of objects containing:

- E-mail address
- MX domain(s)
- MX response code
- MX response message

Installation
------------

[](#installation)

```
composer require peoplefone/mail-validator-mx-server
```

How it works
------------

[](#how-it-works)

These are the requests and responses with the remote MX server.

```
telnet mx.domain.com 25
Trying 66.96.140.73...
Connected to mx.domain.com.
Escape character is '^]'.
220 bosimpinc12 bizsmtp ESMTP server ready
```

```
helo mydomain.com
250 bosimpinc12 hello [95.128.x.x], pleased to meet you
```

```
MAIL FROM:
250  sender ok
```

```
RCPT TO:
250  recipient ok
```

```
quit
221 bosimpinc12 bizsmtp closing connection
```

Example
-------

[](#example)

### Basic Usage

[](#basic-usage)

```
require("vendor/autoload.php");

use peoplefone\mailValidatorMXServer;

$class = new mailValidatorMXServer("mydomain.com", "me@mydomain.com");

$class->setContact("noreply@hotmail.com");
$class->setContact("noreply@gmail.com");
$class->setContact("noreply@yahoo.com");

$result = $class->validate();
print_r($result);
```

### Result

[](#result)

The returned codes correspond to the RFC5321.

For ordinary use, it can be assumed that the e-mail address is valid when code 250 is returned.

```
Array
(
    [0] => stdClass Object
        (
            [mail] => noreply@gmail.com
            [host] => Array
                (
                    [0] => gmail-smtp-in.l.google.com
                    [1] => alt1.gmail-smtp-in.l.google.com
                    [2] => alt2.gmail-smtp-in.l.google.com
                    [3] => alt3.gmail-smtp-in.l.google.com
                    [4] => alt4.gmail-smtp-in.l.google.com
                )

            [code] => 550
            [text] => Requested action not taken: mailbox unavailable (e.g., mailbox not found, no access, or command rejected for policy reasons)
        )

    [1] => stdClass Object
        (
            [mail] => noreply@hotmail.com
            [host] => Array
                (
                    [0] => hotmail-com.olc.protection.outlook.com
                )

            [code] => 250
            [text] => Requested mail action okay, completed
        )

    [2] => stdClass Object
        (
            [mail] => noreply@yahoo.com
            [host] => Array
                (
                    [0] => mta7.am0.yahoodns.net
                    [1] => mta6.am0.yahoodns.net
                    [2] => mta5.am0.yahoodns.net
                )

            [code] => 250
            [text] => Requested mail action okay, completed
        )

)

```

### Settings Functions

[](#settings-functions)

```
/**
 * Port of the remove MX Server.
 */
$class->setConnectionPort("25");

/**
 * Timeout of each connection.
 */
$class->setConnectionTimeOut("30");

/**
 * Timeout of each communication.
 * Note that some MX servers are configured to wait before responding or respond with multiple lines.
 * Perhaps you need to increase the stream timeout to get successful validation.
 */
$class->setStreamTimeOut("15");

/**
 * Pass the Boolean value TRUE to print the debug log.
 */
$class->validate(true);
```

### Contact Functions

[](#contact-functions)

```
$class->setContact("noreply@gmail.com");

$class->unsetContact("noreply@gmail.com");

$class->getContacts()
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2601d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/04110237b678c6d1c2e07a8d5ce11ba0b4d674455795f3dd42069038a9ed0838?d=identicon)[technic@peoplefone.com](/maintainers/technic@peoplefone.com)

---

Tags

checkvalidatormailsmtpMX

### Embed Badge

![Health badge](/badges/peoplefone-mail-validator-mx-server/health.svg)

```
[![Health](https://phpackages.com/badges/peoplefone-mail-validator-mx-server/health.svg)](https://phpackages.com/packages/peoplefone-mail-validator-mx-server)
```

###  Alternatives

[nette/mail

📧 Nette Mail: A handy library for creating and sending emails in PHP.

5389.8M244](/packages/nette-mail)[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[mlocati/spf-lib

Parse, build and validate SPF (Sender Policy Framework) DNS records

67867.9k2](/packages/mlocati-spf-lib)[zytzagoo/smtp-validate-email

Perform email address verification via SMTP

452909.9k3](/packages/zytzagoo-smtp-validate-email)[pear/net_smtp

An implementation of the SMTP protocol

263.0M16](/packages/pear-net-smtp)[txthinking/mailer

A very lightweight PHP SMTP mail sender

10098.9k3](/packages/txthinking-mailer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
