| << SoftBank携帯の絵文字処理について | 質問一覧 | メールの本文を添付ファイルと切り離... >> |
- 募集中!! 0P
PHPMailerでの文字化けについて
- 募集中!! 0P
PHP 5.1.6
PHPMailer 2.2.1
Windows2000(SP4)
「はしご高」「崎の大が立」「○数字」などの文字を含めると文字化けしてしまいます。
php.ini内のエンコーディングは、SJIS-winに設定しています。
「はしご高」などの文字化けを、どうすれば回避できるのでしょうか?
PHPMailer 2.2.1
Windows2000(SP4)
「はしご高」「崎の大が立」「○数字」などの文字を含めると文字化けしてしまいます。
php.ini内のエンコーディングは、SJIS-winに設定しています。
「はしご高」などの文字化けを、どうすれば回避できるのでしょうか?
- require("./phpmailer/class.phpmailer.php");
- mb_language("japanese");
- mb_internal_encoding("SJIS-win");
- $to = "xxx@xxx.com";
- $subject = "subject";
- $body = "body";
- $from = "xxx@xxx.com";
- $fromname = "xx xx";
- $attachfile = "./xxx.txt";
- $mail = new PHPMailer();
- $mail->CharSet = "iso-2022-jp";
- $mail->Encoding = "7bit";
- $mail->AddAddress($to);
- $mail->From = $from;
- $mail->FromName = mb_encode_mimeheader(mb_convert_encoding($fromname,"JIS","SJIS-win"));
- $mail->Subject = mb_encode_mimeheader(mb_convert_encoding($subject,"JIS","SJIS-win"));
- $mail->Body = mb_convert_encoding($body,"JIS","SJIS-win");
- $mail->AddAttachment($attachfile);
- if (!$mail->Send()){
- echo($mail->ErrorInfo);
- }
| SoftBank携帯の絵文字処理について | 質問一覧 | メールの本文を添付ファイルと切り離... |