I'm using ApplicationEvents_11_ItemSendEventHandler
(see http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.applicationevents_11_itemsendeventhandler.aspx) to do some processing when an item is sent from Outlook.
However, as this event fires on "send", rather than "sent", I'm unable to obtain certain information, such as the sender, sent time etc.
Is there an alternative event that fires after the item has actually sent? I've read this blog post; http://easyvsto.wordpress.com/2010/07/27/how-to-save-mail-content-when-a-mail-is-sent-from-outlook/ but I'm wary of depending on items appearing in the sent items folder, considering that a user can disable this feature.
Edit: I should add that I actually have tried the "watch the sent items folder" approach and have noticed that the ItemAdd
event only seems to fire for the first email I send, then not again until I restart Outlook. My code is as follows;
var sentMail = Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail);
sentMail.Items.ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(Items_ItemAdd);
And my method...
void Items_ItemAdd(object item)
{
MessageBox.Show(((Outlook.MailItem)item).Subject);
}