Mail.Save takes a long time RRS feed

  • Question

  • Hello,

    I am developing an Outlook plugin, and ran into some serious issues.

    My design is that I listen to NewMailEx event, extract a few mail properties and add my own user property. This all works fine until I saw when there are bulk emails (e.g Outlook was closed for several hours), the event does not arrive for many emails. So, I implemented a scanner that after sync event goes over emails and adds my property to the ones that don't have it.

    Here is what I got:

    1. I could not run the scanner in a background thread as I saw there is a difficulty to access the model from bg thread

    2. When I go over a lot of emails and save them 1 by 1, it is very heavy on the I/O and Outlook is frozen because of that. Save is going to the pst file and is slow. I called System.Windows.Forms.Application.DoEvents() every time, but it did not help.

    Please advise

    Monday, March 24, 2014 8:23 AM