Support the ongoing development of Laravel.io →
posted 4 years ago
Last updated 1 year ago.
0
moderator

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)

0

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

jdavidbakr jdavidbakr Joined 28 Jul 2015

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.