Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

メールテンプレートのエンコードがJISでは「はしご高」など文字化けもしくは空白になってしまう #373

Merged
merged 2 commits into from
Mar 12, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions data/class/SC_SendMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ public function setReturnPath($return_path)
// 件名の設定
public function setSubject($subject)
{
$this->subject = mb_encode_mimeheader($subject, 'JIS', 'B', "\n");
$this->subject = mb_encode_mimeheader($subject, 'ISO-2022-JP-MS', 'B', "\n");
$this->subject = str_replace(array("\r\n", "\r"), "\n", $this->subject);
}

// 本文の設定
public function setBody($body)
{
// iso-2022-jpだと特殊文字が?で送信されるのでJISを使用する
$this->body = mb_convert_encoding($body, 'JIS', CHAR_CODE);
// iso-2022-jpだと特殊文字が?で送信されるのでISO-2022-JP-MSを使用する
$this->body = mb_convert_encoding($body, 'ISO-2022-JP-MS', CHAR_CODE);
$this->body = str_replace(array("\r\n", "\r"), "\n", $this->body);
}

Expand Down