apavliukov/laravel-email-smtp-validation
最新稳定版本:1.0.6
Composer 安装命令:
composer require apavliukov/laravel-email-smtp-validation
包简介
Validate email address via SMTP to check if it really exists
README 文档
README
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.
Installation
composer require apavliukov/laravel-email-smtp-validation
Usage
Config
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.
Rule
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),
],
];
}
}
统计信息
- 总下载量: 19.88k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-13