Re: Corrupt Japanese mail headers using mb_send_mail

From: Date: Mon, 08 Apr 2002 05:44:09 +0000
Subject: Re: Corrupt Japanese mail headers using mb_send_mail
References: 1  Groups: php.i18n 
Request: Send a blank email to php-i18n+get-254@lists.php.net to get a copy of this message
Hi, You are supposed to encode them by yourself. Use mb_encode_mime() for that. You need to decoded by yourself, too. -- Yasuo Ohgaki Lew Mark-Andrews wrote:
Hi all, Using PHP 4.1.2, mbstring enabled on Linux I've been trying to send a test message containing Japanese Kanji in the "to, from and reply-to" headers using mb_send_mail() as in the following code: <? $my_to = "KANJI KANJI <name@domain.com>"; $my_subject = "KANJI KANJI"; $my_message = "KANJI KANJI KANJI KANJI"; $my_headers = "From: KANJI KANJI <name@domain.com>\r\n"; $my_headers .= "Reply-To: KANJI KANJI <name@domain.com>\r\n"; mb_send_mail($my_to,$my_subject,$my_message,$my_headers); ?> In the received message, the subject and message body Kanji are properly encoded. The Kanji in the other headers is corrupted and unreadable. Looking at the source of the received message's headers shows that those other headers weren't encoded (there's no =?ISO-2022-JP?B?***==?=). I've confirmed that mb_language() was set to Japanese, and Content-Type: text/plain; charset=ISO-2022-JP and Content-Transfer-Encoding: 7bit were visible in the message source. I thought mb_send_mail() encoded all the headers given it. What do I need to do to properly send mail with Kanji in the headers? How is everyone doing this? Any help, pointers, secrets much appreciated. Thanks, Lew Mark-Andrews


« previous php.i18n (#254) next »