Hi,
How do I retrieve a list of undelivered emails using your API?
Hi Mark,
Thank you for writing to us.
I think you want information about retrieving messages that couldn’t be delivered. I have checked this with various messages and would like to share with you that Undelivered messages have contents class equal to “REPORT.IPM.Note.NDR”.
Please have a look at the following example that retrieves all such messages from an Exchange Server using EWS. It uses ExchangeQueryBuilder to retrieve a list of all such messages. Please feel free to contact us if you need further assistance in this regard.
ExchangeWebServiceClient client = GetExchangeClient();
ExchangeMailboxInfo exchangeMailboxInfo = client.GetMailboxInfo();
ExchangeQueryBuilder builder = new ExchangeQueryBuilder();
builder.ContentClass.Equals("REPORT.IPM.Note.NDR");
MailQuery query = builder.GetQuery();
ExchangeMessageInfoCollection msgInfoCollection = client.ListMessages(exchangeMailboxInfo.InboxUri, query, true);
foreach (ExchangeMessageInfo msgInfo in msgInfoCollection)
{
MailMessage mailMsg = client.FetchMessage(msgInfo.UniqueUri);
//Do the required work with mailMsg
}
Hi Kashif,
Hi Marc,
The issues you have found earlier (filed as NETWORKNET-33624) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.