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

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

egulias/email-validator
=======================

A library for validating emails against several RFCs

4.0.4(1y ago)11.6k691.3M↓11.8%226[29 issues](https://github.com/egulias/EmailValidator/issues)[7 PRs](https://github.com/egulias/EmailValidator/pulls)20MITPHPPHP &gt;=8.1CI passing

Since May 19Pushed 1y ago33 watchersCompare

[ Source](https://github.com/egulias/EmailValidator)[ Packagist](https://packagist.org/packages/egulias/email-validator)[ Docs](https://github.com/egulias/EmailValidator)[ GitHub Sponsors](https://github.com/egulias)[ RSS](/packages/egulias-email-validator/feed)WikiDiscussions 4.x Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (76)Used By (20)

EmailValidator
==============

[](#emailvalidator)

[![Build Status](https://github.com/egulias/EmailValidator/actions/workflows/tests.yml/badge.svg)](https://github.com/egulias/EmailValidator/actions/workflows/tests.yml)[![Quality Badge](https://camo.githubusercontent.com/9cc8440043cdcba82752f3b626f30c560e2859ed0fca32068f97e7eae956f656/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3535643434383938633765343465626462346534353735323335363361643633)](https://app.codacy.com/gh/egulias/EmailValidator/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Test Coverage](https://camo.githubusercontent.com/8525c1b3fbad79e6025a98a18ab67ea1e54dd10b8af005404f151526535d6879/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3535643434383938633765343465626462346534353735323335363361643633)](https://app.codacy.com/gh/egulias/EmailValidator/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)[![Latest Release](https://camo.githubusercontent.com/8a1d5742af716415ff7b83265c0e5e3bc1593fd4bba68d09a44bc36c359ed951/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6567756c6961732f456d61696c56616c696461746f72)](https://camo.githubusercontent.com/8a1d5742af716415ff7b83265c0e5e3bc1593fd4bba68d09a44bc36c359ed951/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6567756c6961732f456d61696c56616c696461746f72)

A library for validating emails against several RFC.

Supported RFCs
--------------

[](#supported-rfcs)

This library aims to support RFCs:

- [5321](https://tools.ietf.org/html/rfc5321),
- [5322](https://tools.ietf.org/html/rfc5322),
- [6530](https://tools.ietf.org/html/rfc6530),
- [6531](https://tools.ietf.org/html/rfc6531),
- [6532](https://tools.ietf.org/html/rfc6532),
- [1035](https://tools.ietf.org/html/rfc1035)

Supported versions
------------------

[](#supported-versions)

VersionReleasedEOLOnly critical bug fixesFull**v4.x****2023/01/07**-**X****X**v3.x2020/12/29YESv2.1.x2016/05/16YESv1.22013/19/05YESRequirements
------------

[](#requirements)

- PHP 8.1
- [Composer](https://getcomposer.org) is required for installation
- [Spoofchecking](/src/Validation/Extra/SpoofCheckValidation.php) and [DNSCheckValidation](/src/Validation/DNSCheckValidation.php) validation requires that your PHP system has the [PHP Internationalization Libraries](https://php.net/manual/en/book.intl.php)(also known as PHP Intl)

**Note**: `PHP version upgrades will happen to accomodate to the pace of major frameworks. Minor versions bumps will go via minor versions of this library (i.e: PHP7.3 -> v3.x+1). Major versions will go with major versions of the library`

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

[](#installation)

Run the command below to install via Composer

```
composer require egulias/email-validator
```

Getting Started
---------------

[](#getting-started)

`EmailValidator` requires you to decide which (or combination of them) validation/s strategy/ies you'd like to follow for each [validation](#available-validations).

A basic example with the RFC validation

```
