Hi,
I want to synchronously get newly arrived email and mark the emails that I've gotten as seen. Here is my code:
What am I doing wrong?
Thanks for creating this very useful library!
I want to synchronously get newly arrived email and mark the emails that I've gotten as seen. Here is my code:
folder.Examine();
var messages = folder.Search("UNSEEN", Enums.MessageFetchMode.Minimal);
foreach (var mess in messages)
{
mess.Seen = true;
}
The only time it works as desired is when the unseen message is already in the inbox when the program starts. If an email arrives while the client is already logged in, the message is correctly returned but it is never marked as seen and is therefore returned with every subsequent call to get new messages. If on the other hand I remove the line folder.Examine();, the newly arrived email is never returned in messages (its count is 0).What am I doing wrong?
Thanks for creating this very useful library!