File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ void MimeMessage::setSender(const EmailAddress &sender)
59
59
this ->sender = sender;
60
60
}
61
61
62
+ void MimeMessage::setReplyTo (const EmailAddress &replyTo)
63
+ {
64
+ this ->replyTo = replyTo;
65
+ }
66
+
62
67
void MimeMessage::addRecipient (const EmailAddress &rcpt, RecipientType type)
63
68
{
64
69
switch (type)
@@ -114,6 +119,11 @@ EmailAddress MimeMessage::getSender() const
114
119
return sender;
115
120
}
116
121
122
+ EmailAddress MimeMessage::getReplyTo () const
123
+ {
124
+ return replyTo;
125
+ }
126
+
117
127
const QList<EmailAddress> & MimeMessage::getRecipients (RecipientType type) const
118
128
{
119
129
switch (type)
@@ -193,6 +203,12 @@ void MimeMessage::writeToDevice(QIODevice &out) const {
193
203
header.append (" From:" + formatAddress (sender, hEncoding) + " \r\n " );
194
204
/* ---------------------------------- */
195
205
206
+ /* ---------- Reply-To ----------- */
207
+ if (!replyTo.getAddress ().isEmpty ()) {
208
+ header.append (" Reply-To:" + formatAddress (replyTo, hEncoding) + " \r\n " );
209
+ }
210
+ /* ---------------------------------- */
211
+
196
212
/* ------- Recipients / To ---------- */
197
213
header.append (" To:" );
198
214
for (int i = 0 ; i<recipientsTo.size (); ++i)
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ class SMTP_MIME_EXPORT MimeMessage : public QObject
49
49
/* [2] Getters and Setters */
50
50
51
51
void setSender (const EmailAddress &sndr);
52
+ void setReplyTo (const EmailAddress &repto);
52
53
void addRecipient (const EmailAddress &rcpt, RecipientType type = To);
53
54
void addTo (const EmailAddress &rcpt);
54
55
void addCc (const EmailAddress &rcpt);
@@ -60,6 +61,7 @@ class SMTP_MIME_EXPORT MimeMessage : public QObject
60
61
void setHeaderEncoding (MimePart::Encoding);
61
62
62
63
EmailAddress getSender () const ;
64
+ EmailAddress getReplyTo () const ;
63
65
const QList<EmailAddress> &getRecipients (RecipientType type = To) const ;
64
66
QString getSubject () const ;
65
67
const QStringList &getCustomHeaders () const ;
@@ -82,6 +84,7 @@ class SMTP_MIME_EXPORT MimeMessage : public QObject
82
84
/* [4] Protected members */
83
85
84
86
EmailAddress sender;
87
+ EmailAddress replyTo;
85
88
QList<EmailAddress> recipientsTo, recipientsCc, recipientsBcc;
86
89
QString subject;
87
90
QStringList customHeaders;
You can’t perform that action at this time.
0 commit comments