PHPackages                             service-to/validate-email - 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. service-to/validate-email

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

service-to/validate-email
=========================

Library to validate an email address against its mail servers by doing a name server lookup and then connecting to its MX records.

1.0.11(7y ago)61.3k↓50%1MITPHPPHP &gt;=5.3.0

Since Jun 3Pushed 7y ago3 watchersCompare

[ Source](https://github.com/ServiceTo/ValidateEmail)[ Packagist](https://packagist.org/packages/service-to/validate-email)[ Docs](https://github.com/ServiceTo/ValidateEmail)[ RSS](/packages/service-to-validate-email/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (12)Used By (0)

ValidateEmail
=============

[](#validateemail)

Library to validate an email address against its mail servers by doing a name server lookup and then connecting to its MX records.

Tired of those pesky fake email addresses in your submission forms?
-------------------------------------------------------------------

[](#tired-of-those-pesky-fake-email-addresses-in-your-submission-forms)

Add this little bit of majesty to your form validation rules and your server will connect to the MX records and test the validity of the address the user has entered.

It typically only takes a moment to validate a working address and when an invalid address is entered it takes longer, which can be a win, slowing down annoying script kiddies.

Usage
-----

[](#usage)

### Install using composer...

[](#install-using-composer)

```
composer require "service-to/validate-email"

```

### In a Laravel Controller

[](#in-a-laravel-controller)

```
use ServiceTo\ValidateEmail;

public function store(Request $request) {
	$validateemail = new ValidateEmail;
	try {
		if (!$validateemail->test($request->input("email"))) {
			return redirect()->back()->withErrors(["email" => "Invalid Email Address"])
		}
	}
	catch (\ServiceTo\ValidateEmailException $vee) {
		return redirect()->back()->withErrors(["email" => "Invalid Email Address (" . $vee->getMessage() . ")"])
	}

	// rest of checks...
}

```

### In plain old PHP

[](#in-plain-old-php)

```
require_once("vendor/autoload.php");
use ServiceTo\ValidateEmail;

$errors = array();
$validateemail = new ValidateEmail;
try {
	if (!$validateemail->test($_REQUEST["email"])) {
		$errors["email"] = "Invalid Email Address";
	}
}
catch (ServiceTo\ValidateEmailException $vee) {
	$errors["email"] = "Invalid Email Address (" . $vee->getMessage() . ")";
}

if (count($errors) > 0) {
	// don't move on from here, give the user back some errors...
	header("Content-type: application/json");
	echo(json_encode(array("response" => "error", "errors" => $errors)));
	exit();
}

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

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 ~129 days

Recently: every ~214 days

Total

11

Last Release

2708d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bf01d00c88c951fe9260577dcbb8d231138c16faf60d0c3d0d2b711ebc730e2?d=identicon)[ServiceTo](/maintainers/ServiceTo)

---

Top Contributors

[![ServiceTo](https://avatars.githubusercontent.com/u/4366064?v=4)](https://github.com/ServiceTo "ServiceTo (20 commits)")

---

Tags

validationmailemailvalidateMX

### Embed Badge

![Health badge](/badges/service-to-validate-email/health.svg)

```
[![Health](https://phpackages.com/badges/service-to-validate-email/health.svg)](https://phpackages.com/packages/service-to-validate-email)
```

###  Alternatives

[mlocati/spf-lib

Parse, build and validate SPF (Sender Policy Framework) DNS records

67867.9k2](/packages/mlocati-spf-lib)[stymiee/email-validator

A robust PHP 7.4+ email validation library that extends beyond basic validation with MX record checks, disposable email detection, and free email provider validation. Features include strict typing, custom validator support, internationalization (i18n), and an extensible architecture. Perfect for applications requiring thorough email verification with customizable validation rules.

32426.6k1](/packages/stymiee-email-validator)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[verifalia/sdk

Verifalia provides a simple HTTPS-based API for validating email addresses and checking whether they are deliverable or not. This library allows to easily integrate with Verifalia and verify email addresses in real-time.

4349.8k](/packages/verifalia-sdk)[kouz/laravel-mailgun-email-validation

Laravel email validation that uses the Mailgun API for a three-step validation check.

11141.0k1](/packages/kouz-laravel-mailgun-email-validation)[beebmx/kirby-courier

Courier offers a convenient and painless solution for creating emails tailored for your Kirby website.

403.0k2](/packages/beebmx-kirby-courier)

PHPackages © 2026

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