Mysteriously, using the Pop3Client class with my Gmail account is giving me the one message from my sent mail instead of any messages from my Inbox. The code is very straightforward:
using (var client = new Pop3Client("email@example.com", "password", "pop.gmail.com"))
client.Ssl = true;
client.Port = 995;
var listResults = client.ExecuteList();
foreach (var listResult in listResults)
var top = client.ExecuteTop(listResult.MailIndex, 1);
Currently, I have 6 messages in my Gmail inbox, and 1 message in my sent mail folder; but the code above only enumerates over a single message. When I inspect this message, it is clearly the message from my sent mail.
Any idea what could be going on here? Is this a Gmail issue, perhaps, or could it be an issue with the way Pop3Client works?
Maybe I'm just doing something wrong.