I'm stuck with this. Here is my sample Code. I want to create a mail item and bind it from database like a mail message. and then i want to reply it with outlook' s reply pattern. adding from:, to:, that horizontal line, etc.etc. above theoriginal mail.. but it' s not working for created mail like "Globals.ThisAddIn.Application.CreateItem(OlItemType.olMailItem) as MailItem"
MailItem.Reply() is working perfectly when the MailItem is one of the Globals.ThisAddIn.Application.ActiveExplorer().Selection Items what am i missing here?
thanks..
MailItem oItem = Globals.ThisAddIn.Application.CreateItem(OlItemType.olMailItem) as MailItem;
oItem.Body = "...";
oItem.To = "[email protected]";
oItem.CC = "[email protected]";
oItem.Subject = "....";
MailItem response = oItem.Reply();
Error Codes Here: An exception of type 'System.Runtime.InteropServices.COMException' occurred in HMOutlookAddIn.dll but was not handled in user code
Additional information: Could not send mail.
Error Code: -2147352567