开发者

Get email body from outlook with C#

开发者 https://www.devze.com 2023-01-07 08:20 出处:网络
I\'m writing a program开发者_JAVA百科 that pulls in email, parses it and then stores the entries in a database. So far I can get the subject of the email but when I try to pull in the body I get a COM

I'm writing a program开发者_JAVA百科 that pulls in email, parses it and then stores the entries in a database. So far I can get the subject of the email but when I try to pull in the body I get a COMException ("Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))"). I tried pulling it as the HTMLBody instead but neither is working. I'm using VS2008 and Outlook 2003. Help? If more information is needed let me know....

Updated to add: I have seriously googled my brains out on this error. I have no idea what is causing it, I have NO IDEA why it's throwing this, I can't find a way to map it to a better error so I know what's going on and it's driving me crazy.

So. To recap: Using Microsoft.Office.Interop.Outlook to access Outlook 2007. Cannot pull the body of an email using ((Outlook.MailItem)myInbox.Items[1]).Body.ToString(). However, can pull the Subject, ReceivedTime and various other things. Also can't save an email to a different location because I get the same com error. No one else has ever had this error in the history of google? Help!


I found the following article very helpful in understanding Outlook messages.

Reading an Outlook MSG File in C#

0

精彩评论

暂无评论...
验证码 换一张
取 消