使用 OpenPop.NET 检查 Hotmail 中的新邮件

发布于 2024-10-12 08:03:15 字数 756 浏览 15 评论 0原文

有人建议我使用 OpenPop lib 从 hotmail 获取邮件。但除了断开连接并重新连接之外,我找不到更好的方法来检查新邮件。在那里,我发现了一个问题,Hotmail 不允许每 15 分钟超过 1 个 pop3 登录。我想知道是否可以在不断开并重新连接到他们的 pop3 服务器的情况下获取新邮件。这是我的代码:

        Timer checker = new Timer();
        checker.Interval = 1000;
        checker.Tick += new EventHandler(delegate
        {
            Pop3Client client = new Pop3Client();
            client.Connect("pop3.live.com", 995, true);
            client.Authenticate("[email protected]", "myPassword");
            label1.Text = client.GetMessageCount().ToString();
            client.Disconnect();

        });
        checker.Start();

I was advised to use OpenPop lib to fetch my mail from hotmail. But I could'nt find any better way to check for new mail except disconnecting and reconnecting again. And there, I found a problem, Hotmail doesn't allow more than 1 pop3 login each 15 minutes. I want to know if it's possible to get the new mail without disconnecting and reconnecting to their pop3 server. Here is my code:

        Timer checker = new Timer();
        checker.Interval = 1000;
        checker.Tick += new EventHandler(delegate
        {
            Pop3Client client = new Pop3Client();
            client.Connect("pop3.live.com", 995, true);
            client.Authenticate("[email protected]", "myPassword");
            label1.Text = client.GetMessageCount().ToString();
            client.Disconnect();

        });
        checker.Start();

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小忆控 2024-10-19 08:03:15

我认为服务器不允许在 POP3 会话期间向您显示新邮件。我的基础是,它肯定不能删除电子邮件,因为它会破坏邮件号码。

例如,如果服务器说您有 100 条消息,而当您获取编号为 55 的消息时,它实际上不存在,因为它同时已被删除,会发生什么情况。我认为这同样适用于在会议期间添加新电子邮件。此外,一次只能有一个客户端登录 POP3 帐户,因为该帐户将处于锁定状态。在该锁定状态下,我认为服务器不允许在会话期间更改任何内容。

我不记得 POP3 规范中有任何允许您询问服务器是否已发送新邮件的方法。

如果 Hotmail 确实只允许每 15 分钟一次 POP3 登录,那么我想您就只能这样了。我不知道是否还有其他协议可以在这里使用。不支持 IMAP,因此这不是一个选项。

这不是你想要的答案——但这就是我能给你的。

I do not think that servers are allowed to show new mails to you during a POP3 session. I base this upon that it can certainly not delete emails as it would destroy the message numbers.

What would for example happen if the server says you have 100 messages, and when you fetch the message with number 55, it is actually not there since it was deleted in the meantime. I think the same applies to adding new emails during the session. Also, only one client can be logged into a POP3 account at a time, since the account will then be in a locked state. In that locked state, I do not think servers are allowed to change anything during the session.

I do not recall any methods in the POP3 specification which allows you to ask the server if new messages have been delivered.

If Hotmail does indeed only allow one POP3 login per 15 minutes, then I think you are left with just that. I do not know if there are other protocols which could be used here. IMAP is not supported, so that is not an option.

This is not the answer you want - but it is what I can give you.

抽个烟儿 2024-10-19 08:03:15

Hotmail 不也使用 DeltaSync 来实现 SOAP API 吗?

您可以使用 oSpy 查看通过 SSL 发送和接收的内容,并复制该功能。

Doesn't hotmail use DeltaSync also, for the SOAP API ?

You can use oSpy to see what gets sent and received over SSL, and replicate that functionality.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文