From 8623093e9bd7c4b63a7f9988fcf391a0f2498e25 Mon Sep 17 00:00:00 2001 From: ymuv Date: Mon, 23 Jan 2017 01:56:44 +0200 Subject: [PATCH] Add In-Reply-To field. --- src/mimemessage.cpp | 10 ++++++++++ src/mimemessage.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/mimemessage.cpp b/src/mimemessage.cpp index ea57cf4..d98c27c 100644 --- a/src/mimemessage.cpp +++ b/src/mimemessage.cpp @@ -103,6 +103,11 @@ void MimeMessage::addPart(MimePart *part) }; } +void MimeMessage::setInReplyTo(const QString& inReplyTo) +{ + mInReplyTo = inReplyTo; +} + void MimeMessage::setHeaderEncoding(MimePart::Encoding hEnc) { this->hEncoding = hEnc; @@ -249,6 +254,11 @@ QString MimeMessage::toString() mime += "\r\n"; mime += "MIME-Version: 1.0\r\n"; + if (!mInReplyTo.isEmpty()) + { + mime += "In-Reply-To: <" + mInReplyTo + ">\r\n"; + mime += "References: <" + mInReplyTo + ">\r\n"; + } mime += QString("Date: %1\r\n").arg(QDateTime::currentDateTime().toString(Qt::RFC2822Date)); mime += content->toString(); diff --git a/src/mimemessage.h b/src/mimemessage.h index 18b4ec3..36586f4 100644 --- a/src/mimemessage.h +++ b/src/mimemessage.h @@ -54,6 +54,8 @@ public: void setSubject(const QString & subject); void addPart(MimePart* part); + void setInReplyTo(const QString& inReplyTo); + void setHeaderEncoding(MimePart::Encoding); const EmailAddress & getSender() const; @@ -79,6 +81,7 @@ protected: EmailAddress* sender; QList recipientsTo, recipientsCc, recipientsBcc; QString subject; + QString mInReplyTo; MimePart *content; bool autoMimeContentCreated;