C# OpenPOP index

本文关键字:index OpenPOP | 更新日期: 2023-09-27 18:02:36

我正在使用OpenPOP库来获取Gmail。问题是电子邮件的顺序与收到的顺序不一致。

pop3 = new Pop3Client();
pop3.Connect("pop.gmail.com", 995, true);
pop3.Authenticate("test@gmail.com", "test", AuthenticationMethod.UsernameAndPassword);
emailAmount = pop3.GetMessageSizes().Count;
for (int i = 1; i < emailAmount; i++)
{
    tempMessage = pop3.GetMessage(i);
    tbStatus.Text = ASCIIEncoding.ASCII.GetString(tempMessage.RawMessage);
}
pop3.Disconnect();
pop3.Dispose();

收到的邮件都是零散的。为什么会这样,我该如何解决?

C# OpenPOP index

据我回忆(从我阅读RFC-1939到现在已经有一段时间了),POP3服务器根本没有义务按任何特定顺序列出消息。

因此,如果您关心按照接收到的顺序处理消息,那么在处理它们之前将它们按该顺序排序将由您决定。