0
votes

I started developing an external program to process e-mail messages from the stores in Outlook, and save them in our web application.

Today, I have an Outlook add-in that do this processing, but I wanted to avoid doing this in the add-in, because sometimes Outlook hangs from 1 to 2 seconds.

In the external program, I'm stuck in a situation where a dialog box is prompted, asking for the credentials of a user store, because the user didn't cached his credentials. I want to know if there is a way that I can avoid this dialog box to be shown. Right now, the code that I'm working with is presented below.

RDOSession session = RedemptionLoader.new_RDOSession();
session.Logon();

RDOStore store = null;

for (int i = 1; i < session.Stores.Count; i++)
{
    store = session.Stores[i];
    store.OnNewMail += (entryID) => { MessageBox.Show(entryID); };
}
1
If the credentials aren't cached and you don't provide a log in...how do you get access? - gilliduck

1 Answers

2
votes

Your code will work fine as long as the store is cached. Public Folders stores are most likely not cached, and hence require credentials to access.

But most importantly, NewMail event is only fired on the primary mailbox in the profile, so you only need RDOSession.Stores.DefaultStore.

You can of course use Items.ItemAdd event on the Inbox folder of other stores, but, again, Public Folders stores do not have an Inbox folder. When looping through the stores, check the RDOStore.StoreKind property.