0

我可以发誓这段代码几天前就可以工作了。我正在使用来自http://trixy.justinkbeck.com/2009/07/c-pop3-library-with-ssl-for-gmail.html的 SSL 二进制文件

        POPClient client = new POPClient("pop.gmail.com", 995, "user@gmail.com", "qwerty", AuthenticationMethod.USERPASS, true);

        int unread = client.GetMessageCount();

        for (int i = 0; i < unread; i++)
        {
            Message m = client.GetMessage(i + 1, true);

            Console.WriteLine(m.Subject);

            if (m.HasAttachment)
            {
                Attachment a = m.GetAttachment(1);

                // Problem! HasAttachment flag is set, but there's no attachments in the collection!

                m.SaveAttachment(a, a.ContentFileName);
            }
        }
        client.QUIT();

但是今天,我可以阅读邮件,但附件是空的。我在想中国的惨败让他们改变了一些东西。想法?

4

2 回答 2

2

OpenPop.Net现在本身就直接支持 SSL。它还有很多其他的升级。您应该考虑迁移到新版本。

于 2010-12-10T06:57:04.427 回答
1
Message m = client.GetMessage(i + 1, true);

只得到标题,并将其更改为

Message m = client.GetMessage(i + 1, false);

它再次起作用。

于 2010-01-20T02:59:03.480 回答