Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set name for attachment #110

Open
alexh-swdev opened this issue Oct 22, 2024 · 0 comments
Open

Set name for attachment #110

alexh-swdev opened this issue Oct 22, 2024 · 0 comments

Comments

@alexh-swdev
Copy link

(How) can I set the (file)name for an attachment?
I am adding the file this way:

foreach(QString file, files) {
    auto fi = QFileInfo(file);
    auto fName = fi.fileName();
    auto document = std::make_shared<SimpleMail::MimeAttachment>(std::make_shared<QFile>(file));
    document->setContentName(fName.toUtf8());
    message.addPart(document);
}

The filename is not displayed properly in the email (it is not "human readable"). When I look at the sourcecode, the relevant part looks like

--9cf173c69cdd4e0c8e2d9216259c5b75
Content-Type: text/csv; name="?UTF-8?B?SW52ZW50b3J5TG9nLmNzdg==?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="=?UTF-8?B?SW52ZW50b3J5TG9nLmNzdg==?="

Am I doing this wrong or is this a bug? The filecontent of the attachment "arrives" correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant