PHPackages                             paigejulianne/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. paigejulianne/email-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

paigejulianne/email-validator
=============================

A PHP library to validate email addresses, including syntax, MX record, and SMTP verification.

0.1.0(4mo ago)08MITPHP

Since Dec 25Pushed 4mo agoCompare

[ Source](https://github.com/paigejulianne/email_validation)[ Packagist](https://packagist.org/packages/paigejulianne/email-validator)[ RSS](/packages/paigejulianne-email-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Email Validation Module
=======================

[](#email-validation-module)

A PHP Composer module for robust email address validation. This module performs comprehensive checks, including syntax validation, MX (Mail Exchange) record lookup, and SMTP (Simple Mail Transfer Protocol) server verification to ensure an email address is not only well-formed but also deliverable.

Features
--------

[](#features)

- **Syntax Validation**: Checks if the email address conforms to standard email format rules using `filter_var(FILTER_VALIDATE_EMAIL)`.
- **MX Record Lookup**: Determines if the domain of the email address has valid MX records, indicating it can receive mail.
- **SMTP Verification**: Connects to the domain's SMTP server to verify if the email address is accepted for delivery.

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

[](#installation)

To install this module, navigate to your project's root directory and run the following Composer command:

```
composer require paigejulianne/email-validator
```

Usage
-----

[](#usage)

To use the `EmailValidator` class, you first need to include the Composer autoloader. Then, instantiate the `EmailValidator` and call its `validate` method within a `try-catch` block to handle potential validation exceptions.

```
