IMAPLib is .Net framework 4.5 IMAP library which is absolutely free.
It offers full control on folders and emails.
http://eximiussoftsolutions.com/Downloads.aspx[
^]
See the example -
using ESS.Network.IMAP;
ImapClient objclient = new ImapClient();
objclient.UserName = "******@gmail.com";
objclient.Password = "*******";
objclient.Port = 993;
objclient.Host = "imap.gmail.com";
if (objclient.Connect())
{
if (objclient.SetFolder("Inbox"))
{
Dictionary<string, string> messageIds = objclient.SearchMails(ESS.Network.eMailStatus.ALL);
IDictionaryEnumerator ienum = messageIds.GetEnumerator();
while (ienum.MoveNext())
{
string messageId = (string)ienum.Key;
string msguid = (string)ienum.Value;
string emlstr = string.Empty;
objclient.GetMail(messageId, ESS.Network.eMailIdType.MESSAGEID, ref emlstr);
}
}
}