PHPackages                             mailboxvalidator/mailboxvalidator-yii - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mailboxvalidator/mailboxvalidator-yii

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

mailboxvalidator/mailboxvalidator-yii
=====================================

MailboxValidator Yii framework extension to validate an email by using MailboxValidator API.

2.1.0(2y ago)191MITPHP

Since Dec 5Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/MailboxValidator/mailboxvalidator-yii)[ Packagist](https://packagist.org/packages/mailboxvalidator/mailboxvalidator-yii)[ RSS](/packages/mailboxvalidator-mailboxvalidator-yii/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (7)Dependencies (1)Versions (9)Used By (0)

MailboxValidator Yii Email Validation Extension
===============================================

[](#mailboxvalidator-yii-email-validation-extension)

MailboxValidator Yii Email Validation Extension enables user to easily validate if an email address is valid, a type of disposable email or free email.

This extension can be useful in many types of projects, for example

- to validate an user's email during sign up
- to clean your mailing list prior to email sending
- to perform fraud check
- and so on

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

[](#installation)

Install this extension by using Composer:

`composer require mailboxvalidator/mailboxvalidator-yii`

Dependencies
------------

[](#dependencies)

An API key is required for this module to function.

Go to  to sign up for FREE API plan and you'll be given an API key.

After you get your API key, open your `config/params.php` and add the following line into the array:

```
'mbvAPIKey' => 'PASTE_YOUR_API_KEY_HERE',
```

You can also set you API key in controller after calling library. Just do like this:

```
$mbv = new EmailValidation('PASTE_YOUR_API_KEY_HERE');
```

or like this:

```
['email', MailboxValidator::className(), 'option'=>'YOUR_SELECTED_OPTION','api_key'=>'PASTE_YOUR_API_KEY_HERE',],
```

Functions
---------

[](#functions)

### EmailValidation (api\_key)

[](#emailvalidation-api_key)

Creates a new instance of the MailboxValidator object with the API key.

### validateDisposable (email\_address)

[](#validatedisposable-email_address)

Check whether the email address is belongs to a disposable email provider or not. Return Values: True, False

### validateFree (email\_address)

[](#validatefree-email_address)

Check whether the email address is belongs to a free email provider or not. Return Values: True, False

### validateEmail (email\_address)

[](#validateemail-email_address)

Performs email validation on the supplied email address.

#### Return Fields

[](#return-fields)

Field NameDescriptionemail\_addressThe input email address.domainThe domain of the email address.is\_freeWhether the email address is from a free email provider like Gmail or Hotmail. Return values: True, Falseis\_syntaxWhether the email address is syntactically correct. Return values: True, Falseis\_domainWhether the email address has a valid MX record in its DNS entries. Return values: True, False, - (- means not applicable)is\_smtpWhether the mail servers specified in the MX records are responding to connections. Return values: True, False, - (- means not applicable)is\_verifiedWhether the mail server confirms that the email address actually exist. Return values: True, False, - (- means not applicable)is\_server\_downWhether the mail server is currently down or unresponsive. Return values: True, False, - (- means not applicable)is\_greylistedWhether the mail server employs greylisting where an email has to be sent a second time at a later time. Return values: True, False, - (- means not applicable)is\_disposableWhether the email address is a temporary one from a disposable email provider. Return values: True, False, - (- means not applicable)is\_suppressedWhether the email address is in our blacklist. Return values: True, False, - (- means not applicable)is\_roleWhether the email address is a role-based email address like  or . Return values: True, False, - (- means not applicable)is\_high\_riskWhether the email address contains high risk keywords. Return values: True, False, - (- means not applicable)is\_catchallWhether the email address is a catch-all address. Return values: True, False, Unknown, - (- means not applicable)mailboxvalidator\_scoreEmail address reputation score. Score &gt; 0.70 means good; score &gt; 0.40 means fair; score &lt;= 0.40 means poor.time\_takenThe time taken to get the results in seconds.statusWhether our system think the email address is valid based on all the previous fields. Return values: True, Falsecredits\_availableThe number of credits left to perform validations.error\_codeThe error code if there is any error. See error table in the below section.error\_messageThe error message if there is any error. See error table in the below section.### isDisposableEmail (email\_address)

[](#isdisposableemail-email_address)

Check if the supplied email address is from a disposable email provider.

#### Return Fields

[](#return-fields-1)

Field NameDescriptionemail\_addressThe input email address.is\_disposableWhether the email address is a temporary one from a disposable email provider. Return values: True, Falsecredits\_availableThe number of credits left to perform validations.error\_codeThe error code if there is any error. See error table in the below section.error\_messageThe error message if there is any error. See error table in the below section.### isFreeEmail (email\_address)

[](#isfreeemail-email_address)

Check if the supplied email address is from a free email provider.

#### Return Fields

[](#return-fields-2)

Field NameDescriptionemail\_addressThe input email address.is\_freeWhether the email address is from a free email provider like Gmail or Hotmail. Return values: True, Falsecredits\_availableThe number of credits left to perform validations.error\_codeThe error code if there is any error. See error table in the below section.error\_messageThe error message if there is any error. See error table below.Usage
-----

[](#usage)

### Form Validation

[](#form-validation)

To use this library in form validation, first call this library in your model like this:

```
use MailboxValidator\MailboxValidator;
```

After that, in the function rules, add the new validator rule for the email:

```
['YOUR_EMAIL_FIELD_NAME', MailboxValidator::className(), 'option'=>'disposable,free',],
```

In this line, the extension is been called, and you will need to specify which validator to use. The available validators are disposable and free. After that, refresh you form and see the outcome.

### Email Validation

[](#email-validation)

To use this library to get validation result for an email address, firstly load the library in your controller like this:

```
use MailboxValidator\EmailValidation;
```

After that, you can get the validation result for the email address like this:

```
$mbv = new EmailValidation(Yii::$app->params['mbvAPIKey']);
$results = $mbv->isFreeEmail('example@example.com');
```

To pass the result to the view, just simply add the $results to your view loader like this:

```
return $this->render('YOUR_VIEW_NAME', ['results' => $results]);
```

And then in your view file, call the validation results. For example:

```
echo 'email_address = ' . $results->email_address . "";
```

You can refer the full list of response parameters available at above.

Errors
------

[](#errors)

error\_codeerror\_message100Missing parameter.101API key not found.102API key disabled.103API key expired.104Insufficient credits.105Unknown error.Copyright
---------

[](#copyright)

Copyright (C) 2018-2026 by MailboxValidator.com,

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance50

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~260 days

Recently: every ~446 days

Total

8

Last Release

894d ago

Major Versions

1.0.7 → 2.0.02020-10-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/cfaef446efd8aa75f70fa16fd70d27e065c288235b40ac5dfbb7884c62bb17e2?d=identicon)[MailboxValidator](/maintainers/MailboxValidator)

---

Top Contributors

[![mailboxvalidator-com](https://avatars.githubusercontent.com/u/283543382?v=4)](https://github.com/mailboxvalidator-com "mailboxvalidator-com (24 commits)")

---

Tags

email-validationemail-validatoremail-verificationemail-verifiermailboxvalidatormailboxvalidator-apimailboxvalidator-yiiyiiyii-extensionyii-frameworkyii2disposableemail validationmailboxvalidator

### Embed Badge

![Health badge](/badges/mailboxvalidator-mailboxvalidator-yii/health.svg)

```
[![Health](https://phpackages.com/badges/mailboxvalidator-mailboxvalidator-yii/health.svg)](https://phpackages.com/packages/mailboxvalidator-mailboxvalidator-yii)
```

###  Alternatives

[borales/yii2-phone-input

Yii2 International telephone numbers - Asset Bundle, Behavior, Validator, Widget

1341.6M6](/packages/borales-yii2-phone-input)[codeonyii/yii2-at-least-validator

Validates at least one (or more) attributes.

28253.5k1](/packages/codeonyii-yii2-at-least-validator)[arogachev/yii2-many-to-many

Many-to-many ActiveRecord relation for Yii 2 framework

3541.2k4](/packages/arogachev-yii2-many-to-many)[mailboxvalidator/mailboxvalidator-php

MailboxValidator PHP module enable users to block disposal email, detect free email and validate if an email is valid.

1113.3k2](/packages/mailboxvalidator-mailboxvalidator-php)[yii2mod/yii2-validators

Collection of useful validators for Yii Framework 2.0

1816.8k](/packages/yii2mod-yii2-validators)

PHPackages © 2026

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