如何在 laravel 8 中不发送 'email verfication' 的情况下验证 'valid email' 的电子邮件?

How to validate Email for 'valid email' without sending 'email verfication' in laravel 8?

我想将电子邮件验证为 'entered mail id valid or not' 因为用户输入的垃圾邮件 ID 不存在'

这些是我用过的验证

$request->validate([
            'name' => 'required',
            'email' => 'required|email|unique:users',
            'password' => 'required|min:6',
            'phone'  => 'required',
            'billing_address' => 'required',
            'billing_city' => 'required',
            'billing_state' => 'required',
            'billing_zipcode' => 'required',
            'billing_country' => 'required',
            'payment_gateway_id' => 'required',
        ],
        [
             'payment_gateway_id.required' => 'Please select payment gateway'
        ]);

我担心的是用户输入存在的有效邮件地址。 我使用了一个可用的软件包 https://github.com/tintnaingwinn/email-checker/issues/12,但它给出了有效电子邮件地址的错误。

请帮我找到解决办法。

您无法检查输入的电子邮件地址是否存在,但可以添加 DNS 验证来代替。 Laravel 电子邮件验证规则使用 egulias/email-validator 包和默认选项 RFCValidation。您可以像这样添加 DNSCheckValidation

$request->validate([
            'email' => 'required|email:rfc,dns|unique:users'
]);
DNSCheckValidation: Will check if there are DNS records that signal that the server accepts emails. This does not entail that the email exists.