PHPackages                             madeitbelgium/verifyemail - 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. madeitbelgium/verifyemail

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

madeitbelgium/verifyemail
=========================

PHP Laravel class to verify an email address and make sure it is valid and does exist on the mail server.

1.1.0(5y ago)03LGPL-3.0-or-laterPHPPHP &gt;=7.3

Since Jul 26Pushed 5y agoCompare

[ Source](https://github.com/madeITBelgium/verifyEmail)[ Packagist](https://packagist.org/packages/madeitbelgium/verifyemail)[ RSS](/packages/madeitbelgium-verifyemail/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

PHP Laravel VerifyEmail
=======================

[](#php-laravel-verifyemail)

[![Build Status](https://camo.githubusercontent.com/3d4e8a1a6c3e684cb1208e200df386ff7f12ae7d81d989c17d4fdc6aeec9c779/68747470733a2f2f7472617669732d63692e6f72672f6d616465495442656c6769756d2f766572696679456d61696c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/madeITBelgium/verifyEmail)[![Coverage Status](https://camo.githubusercontent.com/10f60c68f937350d66b4b37f7e1763e991c4ab0619ed77392ca90659b07ac211/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d616465495442656c6769756d2f766572696679456d61696c2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/madeITBelgium/verifyEmail?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/7e47d5bc1637e9dcb4723a42e88affc660cfd3c04c9868137b245b036ca7a7c3/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f766572696679456d61696c2f762f737461626c652e737667)](https://packagist.org/packages/madeITBelgium/verifyEmail)[![Latest Unstable Version](https://camo.githubusercontent.com/001fba2aacb37a562adba76d24d4b16bdc05a7130a7c68ff21c8fbaf6aa1eb4d/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f766572696679456d61696c2f762f756e737461626c652e737667)](https://packagist.org/packages/madeITBelgium/verifyEmail)[![Total Downloads](https://camo.githubusercontent.com/c076bdf65cfef7bf0558e3e68f40e7a48ef7291105e873d27996c1b0b067257e/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f766572696679456d61696c2f642f746f74616c2e737667)](https://packagist.org/packages/madeITBelgium/verifyEmail)[![License](https://camo.githubusercontent.com/75ea44de2b9cec609fec3415bda81f5c924826772efd7aa923f142e5c453a8f0/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f766572696679456d61696c2f6c6963656e73652e737667)](https://packagist.org/packages/madeITBelgium/verifyEmail)

Is a PHP class to verify an email address and make sure it is valid and does exist on the mail server.

This class connects to the mail server and checks whether the mailbox exists or not.

Installation
============

[](#installation)

Require this package in your `composer.json` and update composer.

```
"madeitbelgium/verifyemail": "~1.0"
```

Publish the config file. Set the correct email address.

```
php artisan vendor:publish
```

Documentation
=============

[](#documentation)

Usage
-----

[](#usage)

```
use MadeITBelgium\VerifyEmail\Facades\VerifyEmail;

$ve = VerifyEmail::verify('some.email.address@example.com');
```

OR (You can set another second email address or change the port)

```
$ve = VerifyEmail::verify('some.email.address@example.com', 'my.email.address@my-domain.com', 26);
```

This will return a boolean. True if the email is valid, false otherwise.

The first email address '' is the one to be checked, and the second '' is an email address to be provided to the server. This email needs to be valid and from the same server that the script is running from. To make sure your server is not treated as a spam or gets blacklisted check the score of your server here

If you want to get any errors, call this function after the verify function:

```
print_r(VerifyEmail::getErrors());
```

This will return an array of all errors (if any):

```
Array
(
    [0] => No suitable MX records found.
)
```

If you want to get all debug messages of the connection, call this function:

```
print_r(VerifyEmail::getDebug());
```

This will return an array of all messages and values that used during the process.

```
Array
(
    [0] => initialized with Email: h*****@gmail.com, Verifier Email: sam@verifye.ml, Port: 25
    [1] => Verify function was called.
    [2] => Finding MX record...
    [3] => Found MX: alt4.gmail-smtp-in.l.google.com
    [4] => Connecting to the server...
    [5] => Connection to server was successful.
    [6] => Starting veriffication...
    [7] => Got a 220 response. Sending HELO...
    [8] => Response: 250 mx.google.com at your service

    [9] => Sending MAIL FROM...
    [10] => Response: 250 2.1.0 OK gw8si3985770wjb.84 - gsmtp

    [11] => Sending RCPT TO...
    [12] => Response: 250 2.1.5 OK gw8si3985770wjb.84 - gsmtp

    [13] => Sending QUIT...
    [14] => Looking for 250 response...
    [15] => Found! Email is valid.
)
```

And to see the *raw* debug messages of the server commands sent

```
print_r(VerifyEmail::getDebug(true));
```

which will return an array:

```
Array
(
    [helo] => 250 mx.google.com at your service
    [mail_from] => 250 2.1.0 OK a68si4170774ioe.18 - gsmtp
    [rcpt_to] => 250 2.1.5 OK a68si4170774ioe.18 - gsmtp
    [quit] => 4
)

```

Notes:
------

[](#notes)

- Some mail servers will silently reject the test message, to prevent spammers from checking against their users' emails and filter the valid emails, so this function might not work properly with all mail servers.
- You server must be configured properly as a mail server to avoid being blocked or blacklisted. This includes things like SSL, SPF records, Domain Keys, DMARC records, etc. To check your server use this tool

Support
=======

[](#support)

Support github or mail:

Contributing
============

[](#contributing)

Please try to follow the psr-2 coding style guide.

License
=======

[](#license)

This package is licensed under LGPL. You are free to use it in personal and commercial projects. The code can be forked and modified, but the original copyright author should always be included!

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Total

2

Last Release

2072d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.0

1.1.0PHP &gt;=7.3

### Community

Maintainers

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

---

Top Contributors

[![madeITBelgium](https://avatars.githubusercontent.com/u/20304892?v=4)](https://github.com/madeITBelgium "madeITBelgium (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/madeitbelgium-verifyemail/health.svg)

```
[![Health](https://phpackages.com/badges/madeitbelgium-verifyemail/health.svg)](https://phpackages.com/packages/madeitbelgium-verifyemail)
```

###  Alternatives

[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)

PHPackages © 2026

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