Previously I posted on how to add custom information to the an email header. Obviously we do that for a purpose and need to retrieve it. The Outlook Redemption library makes it very easy to read that information from the email header.
RDOFolder inbox = Session.GetDefaultFolder(rdoDefaultFolders.olFolderInbox);
RDOItems mails = inbox.Items.Restrict("Select * from Folder where Unread='true'");
foreach (object obj in mails)
{
RDOMailItem item = obj as RDOMailItem;
string header = item.get_Fields(PR_TRANSPORT_MESSAGE_HEADERS).ToString();
}
I think retrieving the header can also be done using WebDAV and Office outlook libraries. But redemption makes it much simpler. For more information about Outlook Redemption, click here.
Happy Coding,
Madhu
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment