sniperscope Posted March 27, 2009 Share Posted March 27, 2009 Hi gurus, i have a mail sending mail problem, which does not convert japanese characters correctly. Here is my code below and it does not send correct chars. require_once('jcode.php'); $mailTo = $mail_add; $mailSubject = "メールマガジンのご登録ありがとうございます。"; $mailFrom = "info@info.jp"; $returnMailAddress = $mailFrom; $mailHeader = "From: " . $mailFrom . "\n"; $mailHeader .= "Reply-To: " . $mailFrom . "\n"; $mailHeader .= "Return-Path: " . $mailFrom . "\n"; $mailHeader .= "MIME-Version: 1.0\n"; $mailHeader .= "Content-Type: text/plain; charset=\"ISO-2022-JP\"\n"; $mailHeader .= "Content-Transfer-Encoding: 7bit\n"; $mailHeader .= "X-mailer: PHP/" . phpversion(); $mailSubject = "=?iso-2022-jp?B?" . base64_encode( jcodeconvert( $mailSubject, 0, 3) ) . "?="; $body="-------------------------------------------------\n\n"; $body.="メールマガジンの登録が完了しました。"; $body.="\n-------------------------------------------------\n\n"; $body.="送信日時:".date( "Y/m/d (D) H:i:s", time() )."\n"; $body.="\n-------------------------------------------------\n\n"; mail( $mailTo, $mailSubject, $body, $mailHeader); Regards Quote Link to comment Share on other sites More sharing options...
MadTechie Posted March 27, 2009 Share Posted March 27, 2009 try adding before the mail() $body = mb_convert_encoding($body, "ISO-2022-JP","AUTO"); Quote Link to comment Share on other sites More sharing options...
sniperscope Posted March 27, 2009 Author Share Posted March 27, 2009 try adding before the mail() $body = mb_convert_encoding($body, "ISO-2022-JP","AUTO"); Wonderful, Thanks thousands of times. ;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.