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 MDNHelper::getPossibleMDNs(const message* msg) { std::vector 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. *