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

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

black/email
===========

A simple email value object for your projects

v1.2(9y ago)02613MITPHPPHP &gt;=7.0

Since Oct 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/pocky/Email)[ Packagist](https://packagist.org/packages/black/email)[ Docs](http://www.lablackroom.com)[ RSS](/packages/black-email/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (3)

Email
=====

[](#email)

PHP 5.4+ library to make working with Email safer, easier, and fun!

[![SensioLabsInsight](https://camo.githubusercontent.com/2bc246ad93973364b4d2f97808730e425a24c6a33d6ce56ee3fda3d67646892e/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39626665383334332d306664352d343132622d613366352d3262333634643630326335362f6269672e706e67)](https://insight.sensiolabs.com/projects/9bfe8343-0fd5-412b-a3f5-2b364d602c56)[![Build Status](https://camo.githubusercontent.com/c20c1fee725e63609515268381696c55de1d6196d39eb7ba322b3b3611bce33d/68747470733a2f2f7472617669732d63692e6f72672f626c61636b2d70726f6a6563742f456d61696c2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/black-project/Email)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/921ac1016bd71862b7b3e405c72acc2d9666c79ff11c21330f57a21e9423a150/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626c61636b2d70726f6a6563742f456d61696c2f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/black-project/Email/)[![Latest Stable Version](https://camo.githubusercontent.com/13abf760348c71baea98e6c9db02fd9270465c637daebc5e13de83c145996338/68747470733a2f2f706f7365722e707567782e6f72672f626c61636b2f656d61696c2f762f737461626c652e706e67)](https://packagist.org/packages/black/email)[![Total Downloads](https://camo.githubusercontent.com/6895fc646aaa1146bb6132454eb4f2a2c1200333df80acc27c82abfaa384a45c/68747470733a2f2f706f7365722e707567782e6f72672f626c61636b2f656d61696c2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/black/email)

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

[](#installation)

The recommended way to install Email is through [Composer](https://getcomposer.org/):

```
{
    "require": {
        "black/email": "@stable"
    }
}
```

**Protip:** You should browse the [`black/email`](https://packagist.org/packages/black/email) page to choose a stable version to use, avoid the `@stable` meta constraint.

Usage
-----

[](#usage)

Usage is simple. Just create a new EmailEmail, if your email is invalid an `Email\Exception\InvalidEmailEmailException`will be thrown. Be aware of this, the validation is on the format, not on a A or MX record in a valid DNS.

```
$email = new Email\EmailEmail("foo@bar.com");
$email->getValue(); // return foot@bar.com
$email->getValueAsArray() // return ['recipient' => "foo", 'domain' => "bar", 'tld' => "com"]
```

**List of available getters**

- `getValue()`
- `getValueAsArray()`
- `getRecipient()`
- `getDomain()`
- `getTld()`

**Check if two email are equals**

`isEqualTo(Email\EmailEmail $email)`: Check if two emails are equals

**WARNING**

`FILTER_VALIDATE_EMAIL` will not works with non-standard ASCII characters so an email like this `me@domain.中国` will throw an InvalidEmailAddressException.

`FILTER_VALIDATE_EMAIL` don't know rules of providers. `0me@hotmail.com` is invalid for hotmail but valid for PHP.

License
-------

[](#license)

Email is released under the MIT License. See the bundled LICENSE file for details.

Contributing
------------

[](#contributing)

See [CONTRIBUTING](CONTRIBUTING.md) file.

Credits
-------

[](#credits)

This README is heavily inspired by [Geocoder](https://github.com/geocoder-php/Geocoder) library by the great [@willdurand](https://github.com/willdurand). This guy needs your [PR](http://williamdurand.fr/2014/07/02/resting-with-symfony-sos/) for the sake of the REST in PHP.

Alexandre "pocky" Balmes . Send me [Flattrs](https://flattr.com/profile/alexandre.balmes) if you love my work, [buy me gift](http://www.amazon.fr/registry/wishlist/3OR3EENRA5TSK) or hire me!

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3508d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.4

v1.2PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/86a3a03b53a62ac6bea9885beb48980a4a57dda70e36dc8828d0ececec05a738?d=identicon)[pocky](/maintainers/pocky)

---

Top Contributors

[![pocky](https://avatars.githubusercontent.com/u/204451?v=4)](https://github.com/pocky "pocky (15 commits)")

---

Tags

Value Objectemaillibraryblack-project

### Embed Badge

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

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

PHPackages © 2026

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