Voting

: two minus two?
(Example: nine)

The Note You're Voting On

N03L in Japan
22 years ago
First of all, don't use nl2br in newer php versions unless you WANT to write xhtml...you'll get <br /> tags.

Secondly, you should use JIS, not ISO-2022-JP as the convert TO encoding. If you use ISO... mb_encode_mimeheader seems to fail. They're the same charset anyway.

Now here's why I am really writing. I just discovered that mb_send_mail and mb_encode_mimeheader cannot support hankaku (single byte kana in (S)JIS) at all. If you are making apps for the keitai (mobile) market, this won't do. Therefore, undo your overloading on the mail function and use regular mail and convert everything yourself like this. This is what we did. It seems to work for us. Your mileage may vary.

$strMBS = mb_convert_encoding($strMailBodySend, "JIS", "EUC-JP");

$strMS = mb_encode_mimeheader( mb_convert_encoding($strMailSubj, "JIS", "EUC-JP") );

mail($strToMail, $strMS, $strMBS, $strFrom);

<< Back to user notes page

To Top