I tried to user setCharset() to send non utf-8 email. Therefore I got an invalid mail message that declares specified charset in Contnt-Type header but has utf-8 encoded body texts.
Message-ID: <ed5c1b10ba6f5f51d102627f2c981b9d@localhost>
Date: Mon, 06 Jan 2014 01:16:22 +0900
Subject: =E4=BC=9A=E5=93=A1=E7=99=BB=E9=8C=B2=E3
=81=AE=E3=81=94=E7=A2=BA=E8=AA=8D
From: My Application robot <[email protected]>
To: [email protected]
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-2022-jp
Content-Transfer-Encoding: quoted-printable
=E4=BB=A5=E4=B8=8B=E3=82=92=E3=82=AF=E3=83=AA=E3=83=83=E3=82=AF=E3=81=97=
=E3=81=A6=E4=BC=9A=E5=93=A1=E7=99=BB=E9=8C=B2=E3=82=92=E5=AE=8C=E4=BA=86=
=E3=81=97=E3=81=A6=E3=81=8F=E3=81=A0=
=E3=81=95=E3=81=84=E3=80=82
...
I want to change also Content-Transfer-Encoding header to Base64 or 7bit.
Would Yii support Quoted Printable UTF-8 only?
I want to change also Content-Transfer-Encoding header to Base64 or 7bit
For the SwiftMailer you should use “setEncoder()”:
$message->getSwiftMessage()->setEncoder(…);
There is an issue with charset in case you setup both plain text and HTML body. In this case message charset is not applied to the message parts correctly. I’ll fix this.
Issue resolved by commit 232a223
Thanks! That's looks smart for simple cases.
By the way I've succeeded to create a message perfectly using getSwiftMessage(). Below might be a sample usecase to learn how Japanese would use it.