diff --git a/src/mimemessage.cpp b/src/mimemessage.cpp index 89ea2e1..0f45902 100644 --- a/src/mimemessage.cpp +++ b/src/mimemessage.cpp @@ -59,6 +59,11 @@ void MimeMessage::setSender(const EmailAddress &sender) this->sender = sender; } +void MimeMessage::setReplyTo(const EmailAddress &replyTo) +{ + this->replyTo = replyTo; +} + void MimeMessage::addRecipient(const EmailAddress &rcpt, RecipientType type) { switch (type) @@ -114,6 +119,11 @@ EmailAddress MimeMessage::getSender() const return sender; } +EmailAddress MimeMessage::getReplyTo() const +{ + return replyTo; +} + const QList & MimeMessage::getRecipients(RecipientType type) const { switch (type) @@ -193,6 +203,12 @@ void MimeMessage::writeToDevice(QIODevice &out) const { header.append("From:" + formatAddress(sender, hEncoding) + "\r\n"); /* ---------------------------------- */ + /* ---------- Reply-To ----------- */ + if (!replyTo.getAddress().isEmpty()) { + header.append("Reply-To:" + formatAddress(replyTo, hEncoding) + "\r\n"); + } + /* ---------------------------------- */ + /* ------- Recipients / To ---------- */ header.append("To:"); for (int i = 0; i &getRecipients(RecipientType type = To) const; QString getSubject() const; const QStringList &getCustomHeaders() const; @@ -82,6 +84,7 @@ class SMTP_MIME_EXPORT MimeMessage : public QObject /* [4] Protected members */ EmailAddress sender; + EmailAddress replyTo; QList recipientsTo, recipientsCc, recipientsBcc; QString subject; QStringList customHeaders;