The header of a reply that doesn't work (which is sent from my email to my email) and produces the error 17:43:52 -0500 RE: Question Re: Item 839733 in R/C Marketplace The Header info from the email I reply to and it works is: Return-Path: I have noticed that this works when I am replying to an email from a certain website (which is confusing as heck). / /// Required method for Designer support - do not modify /// the contents of this method with the code editor. Private void ThisAddIn_Shutdown( object sender, System. MessageBox.Show( "Hello, the email body you sent it " + body) Private void Application_ItemSend( object Item, ref bool Cancel) ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend) inspectors = //inspectors.NewInspector += //new .InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector) += new Outlook. Look at the mail1 in the locals, and it's showing this in the body and htmlbody property Body private void ThisAddIn_Startup( object sender, System. Messing around, without trying to "get" the body using string body = mail1.Body The error comes up on the string body = mail1.Body I can't figure why the body would be any different I am going to try your two suggestions, see what I can come up with. I am typing some text in the body, just as I type some into the "To", and "subject". MessageBox.Show("Hello, you email said " + body) MessageBox.Show("Hello, you send an email to " + address ) Outlook.MailItem mail1 = Item as Outlook.MailItem Private void Application_ItemSend(object Item, ref bool Cancel) += new Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend) Private void ThisAddIn_Startup(object sender, System.EventArgs e) Seems like if it works getting the "to" field and stuff, it should be no problem getting the body also. Files\Beginning Visual C# 2008\Chapter09\List try\FirstOutlookPlugin\FirstOutlookPlugin\ThisAddIn.cs:line 25ĭoes anyone know what's up? I have read it may be something to do with security patches and SMIME (which I am trying to read up on). was unhandled by user codeĪt ._t_Body(String Body)Īt _NewInspector(Inspector Inspector) in L:\Pub.
So I can get the To, CC, and subject with theįollowing code, but when I try to get mailItem.Body or mailItem.HTMLBody I get an exception: I first wanted to get some fields from an email written and sent in outlook. I am more or less just trying different things to see how it all works. I am working on an Outlook addin using c#.