Sorry for the rather long pause between replies.
It is somethig like
Code: Select all
$message = new Swift_Message('PF 2008', null, 'text/plain', null, 'iso-8859-2');
// without this, the message header is in iso...1 and therefore malformed
$message->headers->setCharset('iso-8859-2');
$message->attach(new Swift_Message_Part(
iconv('UTF-8', 'ISO-8859-2', "Some text with diak?i?i?š"), // this is OK
'text/plain',
null,
'iso-8859-2'
));
$message->attach(new Swift_Message_Attachment(...));
$from = new Swift_Address('finwe@finwe.info', iconv('UTF-8', 'ISO-8859-2', 'Mat?j Finwe Humpál'));
$swift->send($message, $email, $from);
I'd expect, when creating an instance of Swift_Message with Charset set to 'iso-8859-2', that headers will have that charset, the same way as all other parts unless stated differently.
I've now tried, that even a message with one part has the headers the wrong way (encoded to ISO-8859-1), unless headers charset is set explicitly.
Code: Select all
$message = new Swift_Message(
'PF 2008',
iconv('UTF-8', 'ISO-8859-2', "Some text with diak?i?i?š"),
'text/plain',
null,
'iso-8859-2'
);
$from = new Swift_Address('finwe@finwe.info', iconv('UTF-8', 'ISO-8859-2', 'Mat?j Finwe Humpál'));
// From will result in =?iso-8859-1?B?TWF07GogRmlud2UgSHVtcOFsIA==?=
$swift->send($message, $email, $from);