Getting "To" address for Delivery Failed emails

Hi,

Is it possible to retrieve the original "To" address from a message that failed to deliver? i.e. I want to know who this message was sent originally to.

Thanks,
Mark


This message was posted using Email2Forum by kashif.iqbal.

Hi Mark,

Thank you for using Aspose.Email.

You can retrieve the original “To” address from the message using the “PR_ORIGINAL_DISPLAY_TO_W” property of the message as follow:

MapiMessage mapi = MapiMessage.FromFile(“Undelivered.msg”);
Console.WriteLine("The message was originally sent to: " + mapi.TryGetPropertyString(MapiPropertyTag.PR_ORIGINAL_DISPLAY_TO_W));