Support the ongoing development of →
posted 4 years ago
Last updated 1 year ago.

The problem that you describe is that there is a different between valid email addresses from the RFC and the email addresses that are currently available.

You can extend the test with a validation if an MX records exist for the domain. (If not it isn't possible to deliver the email)


I guess it seems odd to me that you would need to jump through that hoop and apply it to every project in order to limit the scope of valid emails to at least formats that the mailer will accept. There are a couple of validations like that that don't make sense - you can submit an email address that the mailer will choke on but succeeds with the email validation, you can also submit a date that the date validation will pass but that can't be inserted into the database without doing something like Carbon::parse() on it. Maybe that's the intended behavior? What would the best practices be in these situations? I feel like I'm trying to solve a problem that certainly has had to be solved by a lot of Laravel users, and extending the validator for every project just feels ... un-Laraveley.


Sign in to participate in this thread!


Your banner here too?

jdavidbakr jdavidbakr Joined 28 Jul 2015


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.