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