This project is read-only.

How to fetch only one unseen message at a time?

Topics: Help requests
Nov 4, 2014 at 8:00 AM
Hi All,
I was searching for the proper solution of fetching only one unseen message at a time for a long time, and I have also found this thread: which was discussing the same topic. But in the end, there was not good solution and "pavel_azanov" mentioned it will be improved in the next release.

Now I am asking the same question again to find out this solution.

Can any one help me on this issue? I am very appreciated for your help.
Thank you very much.
Best regards

Nov 4, 2014 at 10:24 AM
Hi mengfzcn,

the support for this feature has been improved, now you can supply the count of messages you want to fetch, as well as limit the amount of data you want to be downloaded (such as headers, attachments etc.).

A basic sample for fetching the last unseen message:
// Use default fetching mode (set through client.Behavior.MessageFetchMode, by default: MessageFetchMode.Basic)
// Set count to 1 to fetch only one message
var messages = client.Folder.Search("UNSEEN", MessageFetchMode.ClientDefault, 1);
For more details you can also check the documentation:

Nov 6, 2014 at 8:20 AM
Hi Pavel

Thank you very much for your hint.

Best regards