-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Email validation with german umlauts #13215
Comments
I think you might consider sending a PR with the fix. |
That was my first thought, but I wanted to ask first whether it makes sense. It seems to make sense, but I forgot to mention that the idn_to_ascii() function requires the intl extension for php. This must be updated in the Server Requirements. |
Emails with international characters are invalid email addresses, and swiftmailer will not allow you to send messages to them. |
Hello, good morning. Ran on my tests with the same problem. It seems Swiftmailer is going to fix this in the next release. Maybe it'd be "optimal" not to rely more on FILTER_VALIDATE_EMAIL and switch to "Swift_Validate::email", which seems more complete and, in the near future, will address this problem. Not an expert on the issue but tried to send an email to "áéí@foo.com" and my email client (Mail on Mac) won't let me, though it let me "test@españa.com" through gmail with no further problems. FILTER_VALIDATE_EMAIL fails to validate "test@españa.com". @GrahamCampbell might be interesting reopening the issue? |
I have the problem that the email validation fails if I use an email with german umlauts.
I know, laravel use the filter_var function of php with the filter FILTER_VALIDATE_EMAIL, but this is outdated, because there are so-called IDNs (Internationalized domain names) which are not considered in this filter.
Now we can wait until php reworked it or we can implement an alternative respectively a small solution to convert the domain of an emal to ascii with idn_to_ascii(). The only drawback is that this function requires the intl extension for php.
Here, I have found a solution which works for me. I have implemented a Custom Validation Rules like so:
This solution only convert the domain name from idn in ascii and then we can use the filter_var again.
I think it is a clean solution. What do you say?
The text was updated successfully, but these errors were encountered: