To follow on from the short discussion (#479026) where Darren answered his own question on STATUS by suggesting use of folder.Examine() followed by the folder.Recent and folder.Exists to probably give him what he wanted. I too am trying to get some basic information on each folder without grabbing all of the message data.
I have tried the following code:
Is this the right way of using Examine()?
Many thanks, JanEric
I have tried the following code:
var client = new ImapClient("my.imap.server.com", true);
if (client.Login("username", "pswd"))
{
foreach (Folder folder in client.Folders)
{
folder.Examine();
Console.WriteLine(folder.Name + " Exists:" + folder.Exists.ToString() + "; Unseen:" + folder.Unseen.ToString());
}
}
...
which always shows correctly the number of messages existing in each folder, but always returns zero as the number of messages in each folder which are UNSEEN. This outcome occurs even though there are definitely UNSEEN messages in some folders.Is this the right way of using Examine()?
Many thanks, JanEric