如果我使用Symfony(3.4)SwiftMailer发送text / plain或html邮件,Thunderbird不会显示德语变音符号。
我所有的资源都是UTF-8编码的。
$message = (new \Swift_Message($this->subject))
->setFrom($this->sender)
->setSender($this->sender)
->setTo($this->recipient)
->setSubject($this->subject)
->setBody('Test öäüß','text/html');
$this->mailer->send($message);
主题似乎没问题,但内容有误:
Thunderbird显示:测试öäüß
邮件来源:
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="_=_swift_v4_1515967254_0cffc8849a46a198af559bc5915f8780_=_"
X-Swift-To: root@localhost
X-Swift-To: root@localhost
--_=_swift_v4_1515967254_0cffc8849a46a198af559bc5915f8780_=_
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Test =C3=B6=C3=A4=C3=BC=C3=9F
--_=_swift_v4_1515967254_0cffc8849a46a198af559bc5915f8780_=_
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Test =C3=B6=C3=A4=C3=BC=C3=9F
--_=_swift_v4_1515967254_0cffc8849a46a198af559bc5915f8780_=_--
所以,charset似乎是正确的,但是我的错误是什么?