Validate email address via SMTP to check if it really exists
apavliukov/laravel-email-smtp-validation is a Laravel package for validate email address via smtp to check if it really exists.
It currently has 1 GitHub stars and 27.279 downloads on Packagist (latest version 1.0.6).
Install it with composer require apavliukov/laravel-email-smtp-validation.
Discover more Laravel packages by apavliukov
or browse all Laravel packages to compare alternatives.
Last updated
Laravel package for simpler usage of zytzagoo/smtp-validate-email package to check if email really exists. It retrieves MX records for the email domain and then connects to the domain's SMTP server to try figuring out if the address really exists.
composer require apavliukov/laravel-email-smtp-validation
You can copy config file
php artisan vendor:publish --tag=email-smtp-validation-config
If you want to disable SMTP check on some environments, you can pass them in config on key disable_on_env. By default, local env is disabled to allow you to use fake emails during development.
For example, in your request class you can use Rules\EmailSmtpVerified rule like here
use AlexPavliukov\EmailSmtpValidation\Rules\EmailSmtpVerified;
...
class ValidateEmailRequest extends FormRequest
{
public function rules()
{
return [
'email' => [
'required',
'email',
app(EmailSmtpVerified::class),
],
];
}
}