PHPackages                             nojacko/email-validator - 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. nojacko/email-validator

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

nojacko/email-validator
=======================

Small PHP library to valid email addresses using a number of methods.

1.1.2(9y ago)159401.8k↓60.4%20[1 issues](https://github.com/nojacko/email-validator/issues)[1 PRs](https://github.com/nojacko/email-validator/pulls)1MITPHP

Since Oct 21Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/nojacko/email-validator)[ Packagist](https://packagist.org/packages/nojacko/email-validator)[ RSS](/packages/nojacko-email-validator/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (9)Used By (1)

Email Validator
===============

[](#email-validator)

Small PHP library to valid email addresses using a number of methods.

[![License](https://camo.githubusercontent.com/1811e538763aefbd899f61d1f9dda9043118c956dcda74968216cf52ad6f022a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e6f6a61636b6f2f656d61696c2d76616c696461746f722e737667)](https://github.com/nojacko/email-validator/blob/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/c67915e8f4a49c856f1c8362e3cf3fc48c1ec409168923123a9b1639b7191ec4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e6f6a61636b6f2f656d61696c2d76616c696461746f722e737667)](https://travis-ci.org/nojacko/email-validator)[![Code Quality](https://camo.githubusercontent.com/f4eb56c12415bf12e0597664a10b7b58d2c45d9d038faac4a08b25224e35d511/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f37623361326332343636323234333161626431666334653237353061616531622e737667)](https://www.codacy.com/app/nojacko/email-validator)[![Downloads](https://camo.githubusercontent.com/6fc7f0a22a9c1e2ec0ee3d98d3be950af7ea5afc8a2f0e590b4da6ba4eff3934/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e6f6a61636b6f2f656d61696c2d76616c696461746f722e737667)](https://packagist.org/packages/nojacko/email-validator)[![Github Stars](https://camo.githubusercontent.com/951762f2c53029361896081a1bfccc29ee51b84f9d0323d493d79185832a3af6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f6a61636b6f2f656d61696c2d76616c696461746f722e737667)](https://github.com/nojacko/email-validator/stargazers)

Features
--------

[](#features)

- Validates email address
- Checks for **example** domains (e.g. example.com)
- Checks for **disposable** email domains (e.g. mailinator.com)
- Checks for **role-based** addresses (e.g. abuse@)
- Checks for **MX records** (i.e. can receive email)

Install (using Composer)
------------------------

[](#install-using-composer)

```
composer require nojacko/email-validator:~1.0

```

Usage
-----

[](#usage)

### Generalised Functions

[](#generalised-functions)

- `isValid($email)` Runs all the tests within this library. Returns true or false.
- `isSendable($email)` Checks isEmail, isExample and hasMx. Returns true or false.

### Specific Functions

[](#specific-functions)

If you want more control, use these functions seperately.

- `isEmail($email)` Note: returns true or false only.
- `isExample($email)`
- `isDisposable($email)`
- `isRole($email)`
- `hasMx($email)`

These functions take a single argument (an email address) and return:

- true, when function name is satisfied.
- false, when function name is not satisfied.
- null, when check is not possible, i.e. an invalid email is given.

Examples
--------

[](#examples)

```
$validator = new \EmailValidator\Validator();

$validator->isValid('example@google.com');              // true
$validator->isValid('abuse@google.com');                // false
$validator->isValid('example@example.com');             // false

$validator->isSendable('example@google.com');           // true
$validator->isSendable('abuse@google.com');             // true
$validator->isSendable('example@example.com');          // false

$validator->isEmail('example@example.com');             // true
$validator->isEmail('example@example');                 // false

$validator->isExample('example@example.com');           // true
$validator->isExample('example@google.com');            // false
$validator->isExample('example.com');                   // null

$validator->isDisposable('example@example.com');        // false
$validator->isDisposable('example@mailinater.com');     // true
$validator->isDisposable('example.com');                // null

$validator->isRole('example@example.com');              // false
$validator->isRole('abuse@example.com');                // true
$validator->isRole('example.com');                      // null

$validator->hasMx('example@example.com');               // false
$validator->hasMx('example@google.com');                // true
$validator->hasMx('example.com');                       // null

```

Contribute
----------

[](#contribute)

Contributions welcome!

### Requirements

[](#requirements)

- [Test-driven development](http://en.wikipedia.org/wiki/Test-driven_development)
- Follow [PSR-2 Coding Style Guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
- One change per pull request

### Add/Remove Disposable Domain

[](#addremove-disposable-domain)

See the [email-data-disposable](https://github.com/nojacko/email-data-disposable) project.

### New Feature

[](#new-feature)

If you're planning a new feature, please raise an issue first to ensure it's in scope. The aim is to keep this library small and with one specific purpose.

### Other Contributions

[](#other-contributions)

For anything that isn't a new feature (bug fix, tests, etc) just create a pull request.

Testing
-------

[](#testing)

Test are all located in `tests` folder.

Run tests with phpunit. In root folder, execute `phpunit` in a CLI.

Versioning
----------

[](#versioning)

[Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html)

License
-------

[](#license)

The MIT License (MIT). See LICENCE file.

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance59

Moderate activity, may be stable

Popularity52

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~93 days

Recently: every ~159 days

Total

8

Last Release

3617d ago

Major Versions

0.2.0 → 1.0.02014-11-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1667141?v=4)[James Jackson](/maintainers/nojacko)[@nojacko](https://github.com/nojacko)

---

Top Contributors

[![nojacko](https://avatars.githubusercontent.com/u/1667141?v=4)](https://github.com/nojacko "nojacko (2 commits)")[![thinkspill](https://avatars.githubusercontent.com/u/822133?v=4)](https://github.com/thinkspill "thinkspill (1 commits)")

---

Tags

checkvalidationemaillibrarythrowawaydisposableemail addresscheckerMXrolevalidater

### Embed Badge

![Health badge](/badges/nojacko-email-validator/health.svg)

```
[![Health](https://phpackages.com/badges/nojacko-email-validator/health.svg)](https://phpackages.com/packages/nojacko-email-validator)
```

###  Alternatives

[mattketmo/email-checker

Throwaway email detection library

2842.1M5](/packages/mattketmo-email-checker)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[stymiee/email-validator

A robust PHP 7.4+ email validation library that extends beyond basic validation with MX record checks, disposable email detection, and free email provider validation. Features include strict typing, custom validator support, internationalization (i18n), and an extensible architecture. Perfect for applications requiring thorough email verification with customizable validation rules.

33487.3k1](/packages/stymiee-email-validator)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

254168.5k](/packages/erag-laravel-disposable-email)[verifalia/sdk

Verifalia provides a simple HTTPS-based API for validating email addresses and checking whether they are deliverable or not. This library allows to easily integrate with Verifalia and verify email addresses in real-time.

2057.8k](/packages/verifalia-sdk)[martian/spammailchecker

A laravel package that protect users from entering non-existing/spam email addresses.

412.1k](/packages/martian-spammailchecker)

PHPackages © 2026

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