Skip to content

Set name for attachment #110

Open
Open

Description

@alexh-swdev

(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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions