0

I am using the example from OpenPop.net and I only seem to get 355 messages.

using(Pop3Client client = new Pop3Client())
{
    // Connect to the server
    client.Connect(hostname, port, useSsl);

    // Authenticate ourselves towards the server
    client.Authenticate(username, password);

    // Get the number of messages in the inbox
    int messageCount = client.GetMessageCount();

    // We want to download all messages
    List<Message> allMessages = new List<Message>(messageCount);

    // Messages are numbered in the interval: [1, messageCount]
    // Ergo: message numbers are 1-based.
    // Most servers give the latest message the highest number
    for (int i = messageCount; i > 0; i--)
    {
        allMessages.Add(client.GetMessage(i));
    }

    // Now return the fetched messages
    return allMessages;
}

Did any of you experience this issue? I couldn't find other posts regarding this issue, so I wonder if there is something obvious I am missing out.

jstedfast
  • 35,744
  • 5
  • 97
  • 110
yoozz
  • 247
  • 2
  • 15
  • Try using [MailKit](https://github.com/jstedfast/MailKit). If you get the same problem there, MailKit allows you to get a [protocol log](https://github.com/jstedfast/MailKit/blob/master/FAQ.md#ProtocolLog) really easily to see what the server is telling the client. This might be able to help you figure out the problem... – jstedfast May 08 '15 at 11:02
  • The only code you'll need to change is the for-loop to fetch messages. MailKit uses 0-based indexes whereas OpenPOP.NET uses 1-based indexes. But you could also use `client.GetMessages(0, messageCount);` which will take advantage of the PIPELINE extension if the server supports it (= fast downloads). – jstedfast May 08 '15 at 11:05

0 Answers0