Search code examples
c#outlookvstooutlook-addin

ItemSend event is not firing


I have an Outlook 2007 Add-in (VSTO). Any mail sent with Outlook should be modified before that.

I use the Application.ItemSend event and it works fine if I send an email directly from Outlook (Inspector) or through a custom C# application that uses the Send method of the MailItem.

However, there is some external application that uses Outlook to send mails - which does not trigger the ItemSend event at all. The mail is moved directly to the Outbox (I can even catch the event of ItemAdd on that folder) and then sent.

Another interesting issue is that if I define a deferred delivery rule it works OK if I send a mail with the Inspector or my c# code, but not when this application does it.

My question is when and how can you create a message that passes the ItemSend event?


Solution

  • This is by design: messages created and sent by Simple MAPI or mailto url do not trigger OOM events. This is done on purpose - there were some problems in those scenarios, so events were completely disabled.