Replies: 4 comments
-
|
Partial solution -> Another way ->
It seems to work with Chinese. It seems to work. It has not been tested with real recipients. So, if anyone sees a fatal flaw, ... |
Beta Was this translation helpful? Give feedback.
-
|
It's because you have not set the PHPMailer defaults to ISO-8859-1 (because we can't assume that $mail = new PHPMailer();
$a = $mail->punyencodeAddress('ice@bücher.de');
var_dump($a);
//Result:
ice@xn--b14cher-xwa2143e.deNow with $mail = new PHPMailer();
$mail->CharSet = 'UTF-8';
$a = $mail->punyencodeAddress('ice@bücher.de');
var_dump($a);
//Result:
ice@xn--bcher-kva.de |
Beta Was this translation helpful? Give feedback.
-
|
You are right. French, German, Chinese, Greek — all fixed. You might be right, and I might be shooting myself in the foot, almost, ... For δοκιμή@παράδειγμα.δοκιμή Error: δοκιμή@xn--hxajbheg2az3al.xn--jxalpdlp does not appear to be a valid email address. Whereas, using my method, xn--jxalpdlp@xn--hxajbheg2az3al.xn--jxalpdlp is valid. Another point I ought to mention is the automated reply message sent as HTML. The form user will receive an email in response. If the user’s name is Günter, the reply going out changes u-umlaut to Dear G And so on. Character set is determined by whether the recipient is named Günter or not, but otherwise, I take it all back. When the character set is 'utf-8', PHPMailer::punyencodeAddress works fine. I don't quite agree that the case is resolved. There is more to be said on the subject of I do not claim to know what all those standards imply, but the developers might want to take a closer look at why in particular the part of an email address before the @ is left as-is, while domain and tld are converted. |
Beta Was this translation helpful? Give feedback.
-
|
No, It's bizarre that you would be surprised that your output contains numeric entities when you're the one calling |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I have been playing around a little with non-ascii character addresses. 'Playing' is to be taken literally, because with such an address, it is difficult to test. My server however does return mail delivery failure messages.
In this case, let us say, the intended recipient is ice@bücher.de. Converted as follows ->
$email=$mail->punyencodeAddress($email);The message goes out and the server sends me a mail delivery failure message. It says, ice@xn--b14cher-xwa2143e.de (the punycode) is an unrouteable address.
Shouldn’t ice@bücher.de be converted to this instead: ice@xn--bcher-kva.de. Maybe my server is goofing it up in the mail delivery failure message. Or maybe ice@xn--b14cher-xwa2143e.de is correct? Without knowing the answer that, I do not wish to implement PHPMailer::punyencodeAddress in an online form. If someone does have a non-ascii character email address which they use in the form to get a reply, it might be wrong.
Is ice@xn--b14cher-xwa2143e.de the correct conversion of ice@bücher.de?
Beta Was this translation helpful? Give feedback.
All reactions