title: InterIMAP, Viewing UNREAD IMAP mail and Downloading Attachments in C#
body: <p>I was wondering if anyone can help me on this cause its driving me mad trying get this working</p>
  
  <p>I was working with the trail of mail.dll from <a href="http://www.lesnikowski.com/mail/" rel="nofollow noreferrer">http://www.lesnikowski.com/mail/</a> which is an extremely fantastic tool which unfortunately i cannot afford being a student (even though its around 150eur, its still very expensive to me :/) and this would be a small module in my thesis and my faculty cannot afford to buy these things for students either :/ so anyway I had to go for a free tool  (so please dont suggest any non open source ones - trust me i have tried them ALL).. </p>
  
  <p>Well, i'm trying to explore  InterIMAP, and for several hours have been trying to list unread emails from my gmail account but it just doesn't seem to be working. I can connect just fine but finding the unread emails seems to be no easy task.. I have tried countless approaches but non seem to give me unread emails in my inbox (I have loads of emails in my inbox and i just want the unread ones). Would someone please assist me? I have been trying to get this working for ages now, but documentation is rather lacking and my every attempt has resulted in a fail so far.</p>
  
  <p><strong>Please help!!</strong></p>
  
  <p>Some code i currently have:
  `            IMAPConfig config = new IMAPConfig("myhost", "username", "pass", true, true, "");</p>
  
  <pre><code>        config.CacheFile = "";
  
          IMAPClient client = null;
          try
          {
              client = new IMAPClient(config, null, 5);
          }
          catch (IMAPException e)
          {
              Console.WriteLine(e.Message);
              return;
          }
          Console.WriteLine(DateTime.Now.ToString());
  
  
          IMAPFolder f = client.Folders["INBOX"];
          IMAPSearchResult sResult = f.Search(IMAPSearchQuery.QuickSearchNew()); // &lt;--- Gives me no results even though i do have unread messages!
  </code></pre>