summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/mime/mailtemplates.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/domain/mime/mailtemplates.cpp')
-rw-r--r--framework/src/domain/mime/mailtemplates.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/framework/src/domain/mime/mailtemplates.cpp b/framework/src/domain/mime/mailtemplates.cpp
index 0380fa5c..4a8778f2 100644
--- a/framework/src/domain/mime/mailtemplates.cpp
+++ b/framework/src/domain/mime/mailtemplates.cpp
@@ -970,15 +970,18 @@ KMime::Message::Ptr MailTemplates::createMessage(KMime::Message::Ptr existingMes
970 970
971 KMime::Content *bodyPart; 971 KMime::Content *bodyPart;
972 if (!attachments.isEmpty()) { 972 if (!attachments.isEmpty()) {
973 mail->contentType(true)->setMimeType("multipart/mixed"); 973 bodyPart = new KMime::Content;
974 mail->contentType()->setBoundary(KMime::multiPartBoundary()); 974 bodyPart->contentType(true)->setMimeType("multipart/mixed");
975 mail->contentTransferEncoding()->setEncoding(KMime::Headers::CE7Bit); 975 bodyPart->contentType()->setBoundary(KMime::multiPartBoundary());
976 mail->setPreamble("This is a multi-part message in MIME format.\n"); 976 bodyPart->contentTransferEncoding()->setEncoding(KMime::Headers::CE7Bit);
977 bodyPart->setPreamble("This is a multi-part message in MIME format.\n");
978 bodyPart->addContent(createBodyPart(body.toUtf8()));
977 for (const auto &attachment : attachments) { 979 for (const auto &attachment : attachments) {
978 mail->addContent(createAttachmentPart(attachment.data, attachment.filename, attachment.isInline, attachment.mimeType, attachment.name)); 980 bodyPart->addContent(createAttachmentPart(attachment.data, attachment.filename, attachment.isInline, attachment.mimeType, attachment.name));
979 } 981 }
982 } else {
983 bodyPart = createBodyPart(body.toUtf8());
980 } 984 }
981 bodyPart = createBodyPart(body.toUtf8());
982 mail->assemble(); 985 mail->assemble();
983 986
984 KMime::Content *signedResult = nullptr; 987 KMime::Content *signedResult = nullptr;