diff options
-rw-r--r-- | framework/src/domain/composercontroller.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/framework/src/domain/composercontroller.cpp b/framework/src/domain/composercontroller.cpp index bcfc1a9a..2cd29bfc 100644 --- a/framework/src/domain/composercontroller.cpp +++ b/framework/src/domain/composercontroller.cpp | |||
@@ -401,6 +401,13 @@ static KMime::Content *createAttachmentPart(const QByteArray &content, const QSt | |||
401 | return part; | 401 | return part; |
402 | } | 402 | } |
403 | 403 | ||
404 | static KMime::Content *createBodyPart(const QByteArray &body) { | ||
405 | auto mainMessage = new KMime::Content; | ||
406 | mainMessage->setBody(body); | ||
407 | mainMessage->contentType(true)->setMimeType("text/plain"); | ||
408 | return mainMessage; | ||
409 | } | ||
410 | |||
404 | KMime::Message::Ptr ComposerController::assembleMessage() | 411 | KMime::Message::Ptr ComposerController::assembleMessage() |
405 | { | 412 | { |
406 | auto mail = mExistingMessage; | 413 | auto mail = mExistingMessage; |
@@ -448,10 +455,7 @@ KMime::Message::Ptr ComposerController::assembleMessage() | |||
448 | const auto content = item->data(ContentRole).toByteArray(); | 455 | const auto content = item->data(ContentRole).toByteArray(); |
449 | mail->addContent(createAttachmentPart(content, filename, isInline, mimeType, name)); | 456 | mail->addContent(createAttachmentPart(content, filename, isInline, mimeType, name)); |
450 | } | 457 | } |
451 | auto mainMessage = new KMime::Content; | 458 | mail->addContent(createBodyPart(getBody().toUtf8())); |
452 | mainMessage->setBody(getBody().toUtf8()); | ||
453 | mainMessage->contentType(true)->setMimeType("text/plain"); | ||
454 | mail->addContent(mainMessage); | ||
455 | } else { | 459 | } else { |
456 | //FIXME same implementation as above for attachments | 460 | //FIXME same implementation as above for attachments |
457 | mail->setBody(getBody().toUtf8()); | 461 | mail->setBody(getBody().toUtf8()); |