since it's possible to have Umlaute (e.g. öäü) in the local part of an email address I need to convert them to ascii because Zend-Mail is not able to handle it - it always throws invalid header exception.
So there is this php-function idn_to_ascii which converts domain names to IDNA ASCII format. The problem is that I'm not sure how to use it correctly.
Let's take this email address: testö@domain.com
// doesn't work (unknown error):
idn_to_ascii('testö@domain.com') --> xn--test@domain-ufb.com
If I just convert the local part of the email address it seems to work:
idn_to_ascii('testö') --> xn--test-8qa@domain.com
But what if also the domain part contains Umlaute?
e.g. testö@domainö.com
should I do something like this?
idn_to_ascii('testö').'@'.idn_to_ascii('domainö.com')
Also on the php-homepage someone wrote a comment that you have to skip the high-level domain part (and the official documentation is wrong): see here
idn_to_ascii('domainö') // right
idn_to_ascii('domainö.com') // wrong
I'm so confused now :|
Someone has experience in that? And the worst thing is: I can't even test it because I don't have an email address with Umlaute.