PHPackages                             nepada/email-address - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nepada/email-address

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nepada/email-address
====================

Email address value object.

v3.3.1(9mo ago)848.0k↑102.8%12BSD-3-ClausePHPPHP &gt;=8.1.0 &lt;8.6CI passing

Since Jun 2Pushed 3d ago2 watchersCompare

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

READMEChangelog (10)Dependencies (10)Versions (23)Used By (2)

Email address value object
==========================

[](#email-address-value-object)

[![Build Status](https://github.com/nepada/email-address/workflows/CI/badge.svg)](https://github.com/nepada/email-address/actions?query=workflow%3ACI+branch%3Amaster)[![Coverage Status](https://camo.githubusercontent.com/91b778e1bac0c207f8cdd2d8e48a3a257e5f2a37311cf8465b50c5b8978c9d0c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e65706164612f656d61696c2d616464726573732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/nepada/email-address?branch=master)[![Downloads this Month](https://camo.githubusercontent.com/98e9b162b3f790a53f33fe4e35698fe541ce1beaad1c495677d9401b0eab4426/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e65706164612f656d61696c2d616464726573732e737667)](https://packagist.org/packages/nepada/email-address)[![Latest stable](https://camo.githubusercontent.com/9736175dc9fa84932de1474e75bd0e832aef3380b459797527ab9bcec3ca5bf1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e65706164612f656d61696c2d616464726573732e737667)](https://packagist.org/packages/nepada/email-address)

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

[](#installation)

Via Composer:

```
$ composer require nepada/email-address
```

Usage
-----

[](#usage)

This package provides two implementations of email address value object:

1. `RfcEmailAddress` - it adheres to RFCs and treats local part of email address as case sensitive. The domain part is normalized to lower case ASCII representation.
2. `CaseInsensitiveEmailAddress` - the only difference from `RfcEmailAddress` is that local part is considered case insensitive and normalized to lower case.

It is up to you to decide which implementation suites your needs. If you want to support both implementations, use `Nepada\EmailAddress\EmailAddress` as a typehint. You can also cast one representation to the other using `RfcEmailAddress::toCaseInsensitiveEmailAddress()` and `CaseInsensitiveEmailAddress::toRfcEmailAddress()`.

#### Creating value object

[](#creating-value-object)

```
$rfcEmailAddress = Nepada\EmailAddress\RfcEmailAddress::fromString('Real.example+suffix@HÁČKYčárky.cz');
$rfcEmailAddress = Nepada\EmailAddress\RfcEmailAddress::fromDomainAndLocalPart('HÁČKYčárky.cz', 'Real.example+suffix');

$ciEmailAddress = Nepada\EmailAddress\CaseInsensitiveEmailAddress::fromString('Real.example+suffix@HÁČKYčárky.cz');
$ciEmailAddress = Nepada\EmailAddress\CaseInsensitiveEmailAddress::fromDomainAndLocalPart('HÁČKYčárky.cz', 'Real.example+suffix');
```

`Nepada\EmailAddress\InvalidEmailAddressException` is thrown in case of invalid input value.

#### Converting back to string

[](#converting-back-to-string)

Casting the value object to string, will result in the original (non-canonical) string representation of email address:

```
echo((string) $emailAddress); // Real.example+suffix@HÁČKYčárky.cz
echo($emailAddress->toString()); // Real.example+suffix@HÁČKYčárky.cz
```

#### Canonical string representation of email address

[](#canonical-string-representation-of-email-address)

```
echo($emailAddress->getValue()); // real.example+suffix@xn--hkyrky-ptac70bc.cz
```

#### Getting normalized local and domain part separately

[](#getting-normalized-local-and-domain-part-separately)

```
echo($emailAddress->getLocalPart()); // real.example+suffix
echo($emailAddress->getDomain()); // xn--hkyrky-ptac70bc.cz
```

Integrations
------------

[](#integrations)

- [nepada/email-address-doctrine](https://github.com/nepada/email-address-doctrine) - Email address type for Doctrine.
- [nepada/email-address-input](https://github.com/nepada/email-address-input) - Email address form input for Nette forms.

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance81

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 55.5% 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 ~205 days

Recently: every ~241 days

Total

14

Last Release

280d ago

Major Versions

v1.1.0 → v2.0.02018-10-29

v2.3.0 → v3.0.02020-11-14

PHP version history (8 changes)v1.0.0PHP &gt;=7.1.0

v2.1.0PHP &gt;=7.2.0

v2.2.0PHP &gt;=7.4.0

v3.1.0PHP &gt;=7.4.0 &lt;8.2

v3.1.1PHP &gt;=7.4.0 &lt;8.3

v3.2.0PHP &gt;=8.1.0 &lt;8.4

v3.2.1PHP &gt;=8.1.0 &lt;8.5

v3.3.1PHP &gt;=8.1.0 &lt;8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b4780fe328102c4572737db639653c29d3081d1d3e051467f00d7f09a776399?d=identicon)[xificurk](/maintainers/xificurk)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (156 commits)")[![xificurk](https://avatars.githubusercontent.com/u/117465?v=4)](https://github.com/xificurk "xificurk (124 commits)")[![landure](https://avatars.githubusercontent.com/u/1490071?v=4)](https://github.com/landure "landure (1 commits)")

---

Tags

netteValue Objectemail address

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[nette/php-generator

🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.5 features.

2.3k72.7M765](/packages/nette-php-generator)[nette/component-model

⚛ Nette Component Model

28817.0M106](/packages/nette-component-model)[nette/robot-loader

🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.

89955.0M361](/packages/nette-robot-loader)[nette/security

🔑 Nette Security: provides authentication, authorization and a role-based access control management via ACL (Access Control List)

3889.7M331](/packages/nette-security)[nette/code-checker

✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.

911.7M6](/packages/nette-code-checker)[contributte/di

Extra contrib to nette/di

475.9M18](/packages/contributte-di)

PHPackages © 2026

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