explaingit

egulias/emailvalidator

11,639PHPAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

EmailValidator is a PHP library that checks whether an email address is valid, with pluggable strategies for RFC syntax rules, live DNS lookups, and Unicode spoof detection that you can combine in a single call.

Mindmap

mindmap
  root((EmailValidator))
    What it does
      Validates email addresses
      Multiple strategies
      PHP library
    Strategies
      RFC syntax check
      DNS domain lookup
      Unicode spoof detection
    Usage
      Composer install
      MultipleValidation
      Custom strategies
    Audience
      PHP developers
      Web app builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Validate user-submitted email addresses on a PHP registration or contact form before storing or sending to them.

USE CASE 2

Run DNS validation to confirm the email domain has real mail server records before adding an address to a mailing list.

USE CASE 3

Combine RFC syntax checking, DNS verification, and spoof detection in one pass using MultipleValidationWithAnd.

USE CASE 4

Write a custom validation strategy implementing EmailValidation to enforce proprietary business rules like blocking disposable domains.

Tech stack

PHPComposer

Getting it running

Difficulty · easy Time to first run · 5min

DNS and spoof checks require the PHP intl extension, otherwise a composer require is all that's needed to start validating.

MIT license, use freely for any purpose including commercial, with no restrictions beyond keeping the copyright notice.

In plain English

EmailValidator is a PHP library for checking whether an email address is valid. Validating email addresses is a common need in PHP applications: registration forms, contact forms, and mailing list sign-ups all benefit from knowing whether the address a user typed is properly formed before attempting to send to it. This library handles that job with a set of independent validation strategies you can pick from and combine. The core strategy is RFC validation, which checks that an address follows the format rules defined in the email standards (RFC 5321, 5322, 6530, 6531, and 6532). These RFCs are the technical specifications that define how email addresses are supposed to be structured. A stricter variant called NoRFCWarningsValidation treats even minor deviations from those standards as failures rather than just warnings. A DNS check validation queries the internet to confirm there are actual mail server records for the address domain, which tells you the domain can receive mail, though it does not confirm the specific address exists. A spoof check looks for mixed Unicode characters that could be used to make one email address look visually like another. All of these strategies can be combined using the MultipleValidationWithAnd class, which runs each check in sequence and only returns valid if every one passes. You can also write your own validation by implementing the EmailValidation interface the library provides. Installation uses Composer, the standard PHP dependency manager. The DNS and spoof checks require the PHP internationalization extension (intl) to be installed on your server. The library is released under the MIT license.

Copy-paste prompts

Prompt 1
Show me the Composer require command and minimum PHP code to validate an email address using EmailValidator with RFC rules and DNS checking combined.
Prompt 2
How do I use EmailValidator's MultipleValidationWithAnd to run RFC validation, NoRFCWarningsValidation, and DNS check all in a single call?
Prompt 3
I want a custom EmailValidation strategy that rejects addresses from a list of disposable email domains, show me the interface I need to implement.
Prompt 4
What PHP extensions does EmailValidator's DNS validation and spoof check require, and how do I verify they are installed on my server?
Open on GitHub → Explain another repo

← egulias on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.