Open miknaz opened 3 years ago
Hi @miknaz --
For now, mail-mime-parser has very basic 'write' functionality, and unfortunately the users are left responsible for ensuring that proper encoding, etc... has been applied. In this case, you'd need to follow RFC2231 encoding for parameter values, something like:
See Message::setRawHeader And Message::getPart
$message->addAttachmentPartFromFile('tmp-name.jpeg', $mimeType);
$part = $message->getAttachmentPart(0); // this may be enough depending on your use case, or you may need to use a different method like getPart() with a filter, I linked to the docs for that above
$part->setRawHeader("Content-Type: image/jpeg;\r\nname*=utf-8'en'" . urlencode('imgæ÷ü.jpeg'));
Edit: the attachment is a separate part.
All the best
When I add attachment to message and then convert message object to string, filename is broken.
And this is attachment headers from mime string:
Filename is broken.. (
I use the last 1.2.3 version