Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Bernard123's avatar

Exists Validation Email Address for Mailing

is there any validation for email address in order to prevent mailing to incorrect email address? I'm using Job to sending the mail, so i want the job is going to failed_jobs table when it sends incorrect email address.

0 likes
8 replies
Bernard123's avatar

@RemiM Thank you for replying to my thread! Does this validation ensure that the email address belongs to a real, active user? Because I'm trying such email:rfc,dns, but it didn't seem to make a difference or return an error

RemiM's avatar

@Bernard123 No, it does not. rfc ensures the email follows proper formatting rules, while rfc checks if the domain has valid MX records. You can check the Email Verification documentation that, combine with the email validation rules, may be sufficient for your needs or check for services like Mailgun.

jj15's avatar
jj15
Best Answer
Level 10

If someone mistypes their email address and it goes to someone else, you won't have a way to know that. If you send it to an email address that doesn't exist, that error won't reach your application. It would bounce back to your mail server (which you could monitor programmatically, but this is likely to be overkill).

Laravel provides a built-in dns modifier for the email validation rule. It checks that the domain of an email address (not the mailbox itself) has a valid DNS record (MX) for receiving email:

$request->validate([
    'email' => ['required', 'email:dns'],
]);
1 like
Bernard123's avatar

@jj15 So, my application cannot check if an email exists just by the bounce-back to my mail server and cannot prevent to send the email?

jj15's avatar

@Bernard123

You technically could, if you want to monitor your mail server or the sending email address for bounce-backs. Implementation would depend on your specific setup. Third-party services/APIs may also allow you to detect these bounces (I haven't needed this, so I won't promote or suggest a specific one).

In most cases, I think performing DNS validation at the request level and using the built-in email verification features should suffice.

Please or to participate in this conversation.