tintnaingwinn / email-checker by TintNaingWinn

Laravel Package To Validate If An Email Address Exists Without Sending An Email
46,179
49
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-03-25 03:02:26
Package Statistics
Total Downloads: 46,179
Monthly Downloads: 1,345
Daily Downloads: 15
Total Stars: 49
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.