I'm using POP for mails and I want to inform one of my company mails when a message is sent by one of the users. And I want it hidden so they cannot delete it. I see there are solutions bun not free and not suitable for every version of Outlook.
Is there a short way to code it in c#, like an office add-in or else?
EDIT Here is an example I guess: VSTO Outlook ItemSend with C#
And here is the code:
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
this.Application.ItemSend += new
Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemSendEventHandler(
Application_ItemSend);
}
void Application_ItemSend(object Item, ref bool Cancel)
{
if (Item is Outlook.MailItem)
{
Outlook.MailItem mail = (Outlook.MailItem)Item;
mail.BCC += ";Name Surname<name.surname@tld.com>";
mail.Recipients.ResolveAll();
mail.Save();
}
}
This code worked couple times but now its not working.