views:

94

answers:

0

I'm developing a console application that read a database row and send emails in Outlook. I'm using the event ItemAdd in the sent mail folder to flag a message (a row of a table) as sent also into the db. the code:

_oNS = _oApp.GetNamespace(_outlookNamespaceType);
_oNS.Logon(_profile, Missing.Value, true, true);
//getting the sent mail folder
Outlook.MAPIFolder sentmailFolder = _oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail) as Outlook.MAPIFolder;
//setting the event on adding mail to the sentmail folder => mail has been sent
sentmailFolder.Items.ItemAdd += new Microsoft.Office.Interop.Outlook.ItemsEvents_ItemAddEventHandler(SentItem_ItemAdd);

On my machine everything work... when i test it on a test machine ItemAdd event never get fired!

Any suggestion to debug this?

Thank you in advance