I want to count the number of emails I have in my GMail inbox using IMAPX. Here is what I have written so far:
if (client.Connect()) {
Console.WriteLine("Connected Successfully.");
if (client.Login("MyEmai, "MyPassword")) {
Folder inbox = client.Folders.Inbox;
int count = inbox.Messages.Count();
Console.WriteLine("Total Items:" + count.ToString());
}
}
But it is always returning 0 as output. I'm using Version 3.5 of the IMAPX 2.