diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-08-03 10:10:52 -0600 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-08-03 10:10:52 -0600 |
commit | 555183b91fb00ea2a31b0fee35b9ccd1e116a69a (patch) | |
tree | 85a54b0032f8b1ad2af81c22f8e1e01fdebb229a /framework/src/domain/mime/mailtemplates.cpp | |
parent | b7e18a461fd14ec34723d689f644880964314f1b (diff) | |
download | kube-555183b91fb00ea2a31b0fee35b9ccd1e116a69a.tar.gz kube-555183b91fb00ea2a31b0fee35b9ccd1e116a69a.zip |
Signed attachments
Diffstat (limited to 'framework/src/domain/mime/mailtemplates.cpp')
-rw-r--r-- | framework/src/domain/mime/mailtemplates.cpp | 15 |
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; |