Sending HTML mail in Japanese can be quite a task in itself
with multiple encoding schemes around.

Some problems that arise are
[a] Japanese text gets garbled
[b] Body text is ok, but subject line is garbled
[c] Mail looks ok on one of the mail clients but not on other

Since early days of double byte characters, JIS or ISO-2022-JP has
been the standard encoding for mail containing double byte characters
The below function also uses JIS as the mode of transmission to
achieve compatibility with the many mail clients.

The test will include the following mail clients
(a) Outlook Express
(b) Microsoft Outlook
(c) Netscape Mail 4.7
(d) Netscape Mail 6
(e) Becky
(f) HTML interfaces for mail like yahoo.co.jp and nifty

See the below code which is converting all the needful text to
JIS and in case of subject is also using the mb_encode_mimeheader
function to prevent the subject line getting garbled.

function send_html_mail()
{
	$to  = "to@to.com";;
	$subject = "Enter some Japanese text here";

	$message = "Enter all the Japanese "

	$s_header = "";
	$s_header = $s_header . "MIME-Version: 1.0\r\n";
	$s_header = $s_header . "From: from@from.com\r\n"; ;
	$s_header = $s_header . "Reply-To: reply@reply.com\r\n"; ;
	$s_header = $s_header . "Content-type: text/html; charset=JIS\r\n";
	$s_header = $s_header . "Content-Transfer-Encoding:7bit\r\n";
	$s_header = $s_header . "Bcc: bcc@bcc.com\r\n";;

	mb_language("ja");
	$subject = mb_convert_encoding($subject, "JIS","AUTO");
	$subject = mb_encode_mimeheader($subject);

        $message = mb_convert_encoding($message, "JIS", "AUTO");

	mail($to, $subject, $message, $s_header);
}

Testing this function gave appropriate output to all of the above mail clients

MANISH PRABHUNE
imodeindia.com