Rik Posted July 27, 2012 Share Posted July 27, 2012 Hi all, this is my first post on this great forum, and unfortunately I must start with a... freak question. As you know, Italy lacks money and the "intelligent" IT-Nic got the "great" idea to start selling domains with accented characters to improve their revenues. My first reaction was: "I don't care: if one is pretty idiot to buy that domains deserves all the issues involved!". I'm still thinking that way, but at least for the sake of knowledge, I wonder if there really is a way to send such an email. I'm talking about stuff like this one: [b]info@I?t?rn?ti?n?liz?ti?n.it[/b] that in Italy is now a correct address! I've tried with mb_send_mail() with and without "" with and without <> with and without mb_encode_mimeheader() Nothing to do! The last solution is able to send accented chars but its useless for the address because replying to the email show something like =?UTF-8?B?ScOxdMOrcm7DonRpw7Ruw6BsaXrDpnRpw7huQHJpa3NvZnQuaXQ=?= plus the domain get an added @<mailservername> after the real domain i tried to encode. Have you got any idea? Rik Quote Link to comment https://forums.phpfreaks.com/topic/266330-emails-and-domains-with-special-chars/ Share on other sites More sharing options...
Rik Posted July 27, 2012 Author Share Posted July 27, 2012 On the above post the utf-8 address has been twisted by the forum wich seems not able to show utf-8 strings. I've tried with encoding but no success. Anyway, basically was info@internationalization.it with some italian, german, spanish, finnish, vowel chars. Update: I also notice a very unpleasant, in some cases dangerous behaviour using such addresses: the server where I'm testing, cut off the accented characters from the domain leaving in place the ascii ones, so that the domain name actually CHANGE! So, it's a good idea finding the real solution (sending to UTF-8 address), or being sure to avoid the delivery toward such domains with a preg_match validation on the ascii chars. Quote Link to comment https://forums.phpfreaks.com/topic/266330-emails-and-domains-with-special-chars/#findComment-1364820 Share on other sites More sharing options...
Rik Posted July 31, 2012 Author Share Posted July 31, 2012 Maybe I found a solution, eventually: the punycode. E.g. test@internationalization.it (with the accented vowels I can't write down in this forum), is translated into: test@xn--itrntinliztin-vdb0a5exd8ewcye.it I can't try it for real because I don't own a domain with accented chars, but using this technique in the FROM field of the email it seems to be working properly, in that, when I receive the email it shows the punicode correctly, even when I click "Reply". The ultimate test should be done sending an email to a real address. Class to translate into punycode: http://phlymail.com/en/downloads/idna-convert.html Service online to translate to/from punicode just for test http://www.charset.org/punycode.php Quote Link to comment https://forums.phpfreaks.com/topic/266330-emails-and-domains-with-special-chars/#findComment-1365628 Share on other sites More sharing options...
jazzman1 Posted July 31, 2012 Share Posted July 31, 2012 Could you post out entire mail sending script, please. Quote Link to comment https://forums.phpfreaks.com/topic/266330-emails-and-domains-with-special-chars/#findComment-1365647 Share on other sites More sharing options...
Rik Posted July 31, 2012 Author Share Posted July 31, 2012 I haven't yet implemented the full script with punycode translation because I was looking for alternative solutions, if any. It's pretty freakish to receive emails such as info@xn--itrntinliztin-vdb0a5exd8ewcye.it and could be even more surreal in situations like this: 1) Contact Web form. A guy inserts his data and sends it. 2) The company receives the email and replies (if they don't know of punycode is quite alarming to see). 3) The guy of point 1, who inserted his email in plain utf-8, receives the reply at his address but with this strange, different one which is not what he digited in the web form. Well, provided that he really receives that email (because I doubt antispam likes it too much), I guess he will be a little upset! Quote Link to comment https://forums.phpfreaks.com/topic/266330-emails-and-domains-with-special-chars/#findComment-1365674 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.