Hi,
Thanks for responding.
Here is my code snippet:
using (Imap imap = new Imap())
{
imap.Connect(ConfigurationManager.AppSettings["imapHost"], Convert.ToInt32(ConfigurationManager.AppSettings["imapPort"]));
imap.UseBestLogin(ConfigurationManager.AppSettings["userMail"], ConfigurationManager.AppSettings["password"]);
imap.SelectInbox();
List<long> uids = imap.Search(Flag.Unseen);
List<MessageInfo> infos = imap.GetMessageInfoByUID(uids);
foreach (MessageInfo info in infos)
{
IMail email = new MailBuilder().CreateFromEml(imap.GetMessageByUID(info.UID.Value));
//Do some processing
imap.MarkMessageSeenByUID(info.UID.Value);
}
imap.Close();
}