Skip to content

Commit

Permalink
文字コードをiso-2022-jp、エンコードを7bitに変更
Browse files Browse the repository at this point in the history
  • Loading branch information
Shigehiro IDANI committed Dec 5, 2019
1 parent 71283d6 commit 5bc62be
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/src/Controller/MailerController.php
Expand Up @@ -40,8 +40,6 @@ public function index(MailerInterface $mailer)
この点で、フレームワークはブラックボックスではありません!Symfonyの場合、それはまだPHPです...開発されるアプリケーションはSymfonyユニバースに限定されず、たとえば他のPHPライブラリとネイティブに相互運用できます。
EOL;

mb_language("uni");
mb_internal_encoding("UTF-8");

$subject = mb_encode_mimeheader('日本語のサブジェクトになります。長くなると文字化けするという話もありますので、長く書いてみます。これぐらい長いとどうかな?');
$subject = str_replace("\r\n", '', $subject);
Expand All @@ -53,7 +51,7 @@ public function index(MailerInterface $mailer)

;

$textContent = new TextPart($body, 'utf-8', 'plain', 'base64');
$textContent = new TextPart($body, 'iso-2022-jp', 'plain', '7bit');
$email = new Message($headers, $textContent);

$mailer->send($email);
Expand Down

0 comments on commit 5bc62be

Please sign in to comment.