PHPackages                             choval/email\_parse - 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. choval/email\_parse

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

choval/email\_parse
===================

Email parse and validation functions for PHP

v1.0.1(2y ago)153[1 PRs](https://github.com/choval/email_parse/pulls)MITPHPCI passing

Since Dec 21Pushed 4w ago1 watchersCompare

[ Source](https://github.com/choval/email_parse)[ Packagist](https://packagist.org/packages/choval/email_parse)[ RSS](/packages/choval-email-parse/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (5)Dependencies (1)Versions (8)Used By (0)

choval/email\_parse
===================

[](#chovalemail_parse)

Email functions for validating and parsing emails.

Why
---

[](#why)

1. PHP's `filter_var` doesn't validate Unicode emails.
2. Punycode~
3. Why not?

Install
-------

[](#install)

```
composer require choval/email_parse
```

Functions
---------

[](#functions)

### email\_parse

[](#email_parse)

Parses an email and returns an array with the parts of an email.

```
$parts = email_parse('user@EXAMPLE.COM');
var_dump($parts);
/*
array(11) {
  ["raw"]=>
  string(16) "user@EXAMPLE.COM"
  ["unicode"]=>
  bool(false)
  ["valid"]=>
  bool(true)
  ["idn_domain"]=>
  string(11) "example.com"
  ["idn_local"]=>
  string(4) "user"
  ["idn_tld"]=>
  string(3) "com"
  ["domain"]=>
  string(11) "example.com"
  ["tld"]=>
  string(3) "com"
  ["local"]=>
  string(4) "user"
  ["safe_email"]=>
  string(16) "user@example.com"
  ["email"]=>
  string(16) "user@example.com"
}
*/

// Go crazy
$parts = email_parse('😃@테스트。テスト');
var_dump($parts);
/*
array(11) {
  ["raw"]=>
  string(26) "😃@테스트。テスト"
  ["unicode"]=>
  bool(true)
  ["valid"]=>
  bool(true)
  ["idn_domain"]=>
  string(25) "xn--9t4b11yi5a.xn--zckzah"
  ["idn_local"]=>
  string(8) "xn--h28h"
  ["idn_tld"]=>
  string(10) "xn--zckzah"
  ["domain"]=>
  string(19) "테스트.テスト"
  ["tld"]=>
  string(9) "テスト"
  ["local"]=>
  string(4) "😃"
  ["safe_email"]=>
  string(34) "xn--h28h@xn--9t4b11yi5a.xn--zckzah"
  ["email"]=>
  string(24) "😃@테스트.テスト"
}
*/
```

### email\_valid

[](#email_valid)

Check if an email is valid and returns the email if valid or false.
Uses `email_parse` in the background and returns `email` key.

```
$valid = email_valid('😃@테스트。テスト');
var_dump($valid);
// string(24) "😃@테스트.テスト"

// Non valid because of starting dot
$valid = email_valid('.😃@테스트.テスト');
var_dump($valid);
// bool(false)
```

### email\_safe

[](#email_safe)

Check if an email is valid and returns the email in punycode if valid or false.
Uses `email_parse` in the background and returns `safe_email` key.

```
$valid = email_safe('😃@테스트。テスト');
var_dump($valid);
// string(34) "xn--h28h@xn--9t4b11yi5a.xn--zckzah"

// Non valid because of starting dot
$valid = email_safe('.😃@테스트.テスト');
var_dump($valid);
// bool(false)
```

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance61

Regular maintenance activity

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

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

5

Last Release

910d ago

Major Versions

v0.1.2 → v1.0.02022-01-01

### Community

Maintainers

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

---

Top Contributors

[![choval](https://avatars.githubusercontent.com/u/794926?v=4)](https://github.com/choval "choval (8 commits)")

---

Tags

emailemail-parseremail-validationparsephppunycodeunicodevalidate

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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