携帯メールの文字化け(ソフトバンク)

PHPメールを携帯に送ることが多いのだけど
どういうわけか、ソフトバンクでは文字が化け化けである。

メールのヘッダー部分にcharset=SJISとするとよいなんて
記事を読んだことがあるので、試してみようと思う。

結果は後日・・・。

その結果だが、本文は以下のようにすれば文字化けは
起こらないようである。

しかし、Subjectは相変わらず文字化けになる。

 $sbj = “メールテスト送信”;
 $body.=”ここに本文”.”\n\n”; 
 $to   = “****@softbank.ne.jp“; 
 $header=”From: ****@mail.com”.”\nReply-To: “.”".”\r\nContent-Type: text/plain;charset=sjis\r\nX-Mailer: PHP/”.phpversion(); 
 //カスタマーにデータ送信
 mail($to,$sbj,$body,$header);

そこで・・ 次のスクリプトを試してみる

 $sbj = “アフィリエイト駆け込み寺申し込み”;
 $body=”■■申し込み者■■\n\n”;
 $body.=”__________________________________________________\n\n”;
 $body.=”名前:”.$name_sei.$name_mei.”\n\n”;
 $body.=”メールアドレス:”.$mailaddress.”\n\n”; 
 $body.=”__________________________________________________\n\n”;
 $body.=”    Presented By 7Starweb.com\n\n”;

 mb_language(”Japanese”);
 mb_internal_encoding(”SJIS”);
 $from = $mailaddress;
 $to   = “test@7starweb.com”; 
 //システムにデータ送信
 $rcd = mb_send_mail($to,$sbj,$body,$from);

なるほど、これだとソフトバンクでもドコモでもうまく送信できるみたいだ。




You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply