Count number of emails in gmail using IMAP
问题 Can anyone tell me how I can get the number of unread items in my inbox from gmail using imap or something else and display it in a label in C# WinForms? I tried using atom feeds, but never could get it Here is what I want to look like, if it helps: 回答1: You probably want to find all messages with the UNSEEN flag set. Imap imap = new Imap(); /* connect, login, etc. */ imap.Connect(...); /* fill login and select folder code */ List<long> unseenList = imap.SearchFlag(Flag.Unseen); // now you