[PHP-dev 288] Re: Corrupt Japanese mail headers using mb_send_mail

Yasuo Ohgaki php-dev@php.gr.jp
Mon, 08 Apr 2002 14:28:22 +0900


こんにちわ。大垣です。

php.i18nで見かけました。

たしか、自分で変換すると思ったのですが自動で変換できるように
するとシングルバイトアプリの日本語化に便利と思います。

# 既存のアプリとの整合性を取る為に、ini設定などを
# 利用した方が良さそうですが、、
# 手動で変換するのは何か難しい問題があった為でしょうか?

--
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
> 
>