0
votes

We are using the EWS API (2010) with usage : SubscribeToPullNotifications ( FolderIDs, 300, CurrentWatermark, EventType.NewMail ) to read the emails from an exchange account into our program. However, even though the folder ids that are sent unique to each folder, when the email events are received back, i gets only the events from all folders except Sent Items folder.

The complete flow which i am using :

  • Initial Sync : All folders [including sent items] ) are synced along with their mails. This information is stored to DB.
  • Subsequent sync : The unique folder ids, along with the water mark received is sent for taking the next / updated batch of mails. (This doesn't give sent items folder mails).

Did any one face this issue ?. Do i need to do any extra steps to ensure the sent items folders are also synced and their mails are received in.

1
Are you confident that the sent items folder has actually changed between initial and subsequent sync?Tom Makin

1 Answers

0
votes

Your subscribing to the EventType.NewMail event this event only occurs when new email is delivered to the Inbox. When somebody sends an Email a copy of that email is saved to the SentItems folder but this won't trigger the NewMail event because its not a delivery its just a creation so you need to also listen for EventType.Created to pickup new emails that are added to the SendItems folders.

A good tool to test this with is the EWSEditor https://ewseditor.codeplex.com/ it will let you subscribe to all events and you can then see exactly what event occurs when actions are taken on a Mailbox without needing to write any code.

Cheers Glen