tintnaingwinn / email-checker by TintNaingWinn

Laravel Package To Validate If An Email Address Exists Without Sending An Email
54,573
51
3
Package Data
Maintainer Username: TintNaingWinn
Maintainer Contact: amigo.k8@gmail.com (Tint Naing Win)
Package Create Date: 2017-03-24
Package Last Update: 2021-12-05
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-12-12 15:02:51
Package Statistics
Total Downloads: 54,573
Monthly Downloads: 710
Daily Downloads: 39
Total Stars: 51
Total Watchers: 3
Total Forks: 21
Total Open Issues: 5

Validate Email for Laravel

Latest Version on Packagist Software License Total Downloads

Features

This package supports:

  • Validate with SMTP
  • Support for Disposable Email

Notice - That extracts the MX records from the email address and connect with the mail server to make sure the mail address accurately exist. So it may be slow loading time in local and some co-operate MX records take a long time .

Quick Installation

composer require tintnaingwin/email-checker

For laravel >=5.5 that's all. This package supports Laravel new Package Discovery.

If you are using Laravel < 5.5, you also need to add the service provider class to your project's config/app.php file:

Service Provider
Tintnaingwin\EmailChecker\EmailCheckerServiceProvider::class,
Facade
'EmailChecker' => Tintnaingwin\EmailChecker\Facades\EmailChecker::class,

Example

To add 'email_checker' at email rule

  // [your site path]/app/Http/Requests/RegisterRequest.php
 public function rules()
     {
         return [
             'name'  => 'required|max:255',
             'email' => 'bail|required|email|max:255|unique:users|email_checker',
             'password' => 'bail|required|min:6|confirmed',
         ];
     }

Example Usage With Facade

// reture boolean
EmailChecker::check('me@example.com');

Testing

You can run the tests with:

vendor/bin/phpunit

Credit

License

The MIT License (MIT). Please see License File for more information.