To navigate to the actual mailItem element, use the entry identifier passed in the newMailEx event. Your response to other posts suggests that this does not work for you in any way, but I assume we figured it out and provide you with sample code:
void MyApplication_NewMailEx(string anEntryID) { Outlook.NameSpace namespace = this.GetNamespace("MAPI"); Outlook.MAPIFolder folder = this.Session.GetDefaultFolder( Outlook.OlDefaultFolders.olFolderInbox ); Outlook.MailItem mailItem = (Outlook.MailItem) outlookNS.GetItemFromID( anEntryID, folder.StoreID );
To answer the second part of your question, as soon as you receive mail through this event, it has already been stored in your mailbox, so nothing is needed there. You saved it to disk using MailItem.SaveAs .
source share