I have made a C# program that lets me fill in blanks to an email template that then writes the email to send. I need it to instead write this email as a reply to a certain email in an outlook subfolder that can be uniquely identified by a part of it's subject line.
I have already created the email to send using Microsoft.Office.Interloop.Outlook.Application
string s = "";
OutlookApp outlookApp = new OutlookApp();
MailItem mailItem = outlookApp.CreateItem(OlItemType.olMailItem);
mailItem.To = "email";
mailItem.CC = "email";
mailItem.Subject = $"RE: Bulk Error {bulkNo}";
s = $"<html><body>Bulk Number:       {bulkNo}<br />"
+ $"Account Number:     {acntNo}<br />"
+ $"Policy Number:       {polNo}<br />"
+ $"Trans Type:         {transType}<br />"
+ $"LOB:             {lob}<br />"
+ $"Form Number:       {formNo}<br />"
+ $"Error:             {error}<br />"
+ $"Root Cause:         {rootCause}<br />"
+ $"XML Status:         {xmlStatus}</body></html>"
+ ReadSignature();
mailItem.HTMLBody = s;
mailItem.Display();
The current result is just a new email. I'm trying to get it to be a response to an existing email.
My biggest issues are that I don't know how to
- make this message a reply
or
- How to identify the email i want to reply to.