我正在寻找一种使用 HTTP 快速检查 hotmail 收件箱的方法或库。请注意,它必须通过 Http 而不是 pop3 或 Imap(无论如何都不支持)。我需要它,因为我需要使用 pop3 会话中不支持的 Http 代理连接到多个帐户。任何形式的帮助表示赞赏。
谢谢朋友=]
I believe it is currently not possible without simulating what the user would do within a browser. Easiest way to go is to use "VS2010 Test Professional" or "VS2010 Ultimate" abilities to record a browsing session and generate C# code which does the same! See here, it worked for me quite well out-of-the-box and generates readable code you can re-use in your applications
BWT, those seems to be the existing APIs:
- pop3.live.com, port 995 (SSL Required) for incoming mails;
- smtp.live.com, port 25 (no SSL) or 587 (SSL) for sending e-mail;
- Windows Live Messenger Contacts API (legacy) allows accessing the contacts;
- Windows Live Messenger Connect allows doing anything messenger can do;
- Windows Live Messenger Mailbox properties allow to see the number of mails and unread mails;
没有使用 HTTP(S) 阅读 Hotmail 的官方方法。曾经有DAV,但现在已经被淘汰了,官方声明如下:
Windows Mail 和 Outlook 连接器都使用未记录的名为DeltaSync的协议。
有些人正试图像这个人一样对其进行逆向工程:DeltaSync HU01 解压代码已发布,但绝对不能保证它不会进化——事实上,你可以肯定它会进化 :-)
因此,您最好使用 POP3:Hotmail 和 MSN 帐户 POP3/SMTP 访问
您可以使用隐藏的 WebBrowser 控件。然后使用源代码捕获电子邮件标题和所有内容。在那个答案中,我解释了如何做到这一点。
我认为这是最简单的方法。
这可能不是您想要的,但您可以通过 http 建立一个 pop3 连接。不利的一面是,您需要一个可以连接到局域网之外的服务器。这是一个示例:Pop3 over Http
您需要对 DeltaSync 协议进行反向工程。使用 32 位版本的 MS-Mail 和 oSpy 捕获 SSL 数据包 + Wireshark 捕获 http 数据包。
Try looking at WaTiN. It's a framework we use to perform tests on our webapplication, mimicing user interaction. We also use to to communicate with Mailinator to check dummy emails.
I'm pretty sure WaTiN can be of help here, but the downside is that it will actually open a specific browser, so if you can live with that, it's the way to go.
You could also make webrequests and provide the correct post data to perform a login, it's not that difficult really. Afterwards, just parse the content of the response to check if there's email.
You used to be able to use the System.Net.mail namespace and mailclients to connect to the hotmail servers directly, but i'm not sure if hotmail still allows this.
不确定这是否有帮助: