This project is read-only.

Problem with IMAPSearchQuery.QuickSearchNew()

Apr 2, 2010 at 12:04 AM

I have been trying for several hours to obtain a list of unread messages but it wont seem to work unfortunately. I have been trying:

IMAPConfig config = new IMAPConfig("", "uname", "pass", true, true, "INBOX");
config.CacheFile = "";

IMAPClient client = null;
try { client = new IMAPClient(config, null, 5);
catch (IMAPException e)

IMAPFolder f = client.Folders["INBOX"];
IMAPSearchResult sResult = f.Search(IMAPSearchQuery.QuickSearchNew()); //<-- This always results no results even though i DO have unread messages

i had also tried:
//foreach (int id in msgCount) //{ // IMAPMessage msg = f.GetMessageByID(id); // // do some logic here // msg.MarkAsRead(); //} but this was too slow and it read each and every email in INBOX and i have 32k messages there

I would really really appreciate any help on this as i'm using this for my thesis and im really stuck. Please help!


Apr 4, 2010 at 3:32 PM


Please see my reply to maxdmg's post on march 26th.  i explain how you can achieve this with the asynchronous client.