views:

23

answers:

0

Hi,

I created "email management" tool that does bulk email management(standalone exe C# .NET4 application that "connects" to Oulook 2007 and via Microsoft.Office.Interop.Outlook "monitors" all user emails; not Outlook Add-in but standalone exe app + there are reasons why it's not addin architecture).

Now, during testing phase I realised that some emails are not "imported". COM exception is thrown if email satisfies both criteria specified below:

  • email has digital signature, AND
  • mail sender asked for read receipt

And, when I try to get email EntryID or Subject or any other property, exception is thrown.

        oApp = new Outlook.Application();
        dynamic odMsg = oApp.Session.GetItemFromID( "000000ef00h45785....etc." );
        string key = odMsg.EntryID; // <=== exception thrown on signed 
                // email with read receipt turned on

In third line, Interop throws COM exception 80040F01 (-2147217663). There is no single relevant source of info on google search engine about this COM exception.

CLR text explanation for this errorCode is: "This digitally signed e-mail has a receipt request and so cannot be opened in a UI-less mode."

Environment: Vista with latest SP, Outlook 2007 with latest SP, VS 2010 PRO.

Any hint about how to programmaticaly get message body, subject and recipients? (via Microsoft.Office.Interop.Outlook of course)

Regards, Nick