aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mdn/MDNHelper.cpp17
-rw-r--r--vmime/mdn/MDNHelper.hpp14
2 files changed, 31 insertions, 0 deletions
diff --git a/src/mdn/MDNHelper.cpp b/src/mdn/MDNHelper.cpp
index 72dfeb93..324807e0 100644
--- a/src/mdn/MDNHelper.cpp
+++ b/src/mdn/MDNHelper.cpp
@@ -27,6 +27,23 @@ namespace vmime {
namespace mdn {
+void MDNHelper::attachMDNRequest(message* msg, const mailboxList& mailboxes)
+{
+ header* hdr = msg->getHeader();
+
+ hdr->DispositionNotificationTo().setValue(mailboxes);
+}
+
+
+void MDNHelper::attachMDNRequest(message* msg, const mailbox& mbox)
+{
+ mailboxList mboxList;
+ mboxList.appendMailbox(mbox.clone());
+
+ attachMDNRequest(msg, mboxList);
+}
+
+
const std::vector <sendableMDNInfos> MDNHelper::getPossibleMDNs(const message* msg)
{
std::vector <sendableMDNInfos> result;
diff --git a/vmime/mdn/MDNHelper.hpp b/vmime/mdn/MDNHelper.hpp
index 7eaf64e8..a1053cfd 100644
--- a/vmime/mdn/MDNHelper.hpp
+++ b/vmime/mdn/MDNHelper.hpp
@@ -37,6 +37,20 @@ class MDNHelper
{
public:
+ /** Attach a MDN request to the specified message.
+ *
+ * @param msg message in which to add a MDN request
+ * @param mailboxes list of mailboxes to which the MDN will be sent
+ */
+ static void attachMDNRequest(message* msg, const mailboxList& mailboxes);
+
+ /** Attach a MDN request to the specified message.
+ *
+ * @param msg message in which to add a MDN request
+ * @param mbox mailbox to which the MDN will be sent
+ */
+ static void attachMDNRequest(message* msg, const mailbox& mbox);
+
/** Return a list of possible MDNs that can be generated
* for the specified message.
*