MailSoライブラリを使用して MIME メッセージを作成しようとしています。次のステップは添付ファイルの処理です。添付ファイルがバイナリ ファイルの場合はすべて問題ありませんが、次のようにプレーン テキストの添付ファイルを追加しようとすると、
$rResource = "Some plain text goes here";
$sFileName = 'text.txt';
$iFileSize = \strlen("Some plain text goes here");
$bIsInline = false;
$bIsLinked = false;
$sCID = $metadataCID;
$aCustomContentTypeParams = array(\MailSo\Base\Enumerations\Encoding::QUOTED_PRINTABLE_LOWER);
$oMessage->Attachments()->Add(
\MailSo\Mime\Attachment::NewInstance(
$rResource,
$sFileName,
$iFileSize,
$bIsInline,
$bIsLinked,
$sCID,
$aCustomContentTypeParams
)
);
私はその添付ファイルを次のように見ることを期待しています
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename=text.txt
ただし、常に base64 に強制することはなく、コンテンツタイプの部分に文字セットを追加することもありません
Content-Type: text/plain; name="text.txt"
Content-Disposition: attachment; filename="text.txt"
Content-Transfer-Encoding: base64
それに関するヒントはありますか?