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 = "[email protected]"; $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 Link to comment https://forums.phpfreaks.com/topic/151335-solved-send-mail-does-not-send-mail/ 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"); Link to comment https://forums.phpfreaks.com/topic/151335-solved-send-mail-does-not-send-mail/#findComment-794874 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. ;) Link to comment https://forums.phpfreaks.com/topic/151335-solved-send-mail-does-not-send-mail/#findComment-794882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.