I want to forward an existing Email from my Outlook inbox folder. On recent research I found some different solutions:
My goal is to find a simple way to forward an existing Email to another E-Mail adress.
My code enclosed does not have access to send!
private void buttonExplorer_Click(object sender, RibbonControlEventArgs e)
{
Microsoft.Office.Interop.Outlook.Selection mySelection = Globals.ThisAddIn.Application.ActiveExplorer().Selection;
Microsoft.Office.Interop.Outlook.MailItem mailItem = null;
foreach (Object obj in mySelection)
{
if (obj is Microsoft.Office.Interop.Outlook.MailItem)
{
mailItem = (Microsoft.Office.Interop.Outlook.MailItem)obj;
mailItem.Forward();
mailItem.Recipients.Add("[email protected]");
mailItem.Send();
}
}
}
Would be nice if there is a simple way to solve the forwarding event issue.
Forward()
creates a new item, as stated here.
So you'll need to use that new item from then on:
var newItem = mailItem.Forward();
newItem.Recipients.Add("[email protected]");
newItem.Send();