C# 通过 HTTP 检查 Hotmail 收件箱
我正在寻找一种快速方法或库来使用 HTTP 检查 hotmail 收件箱。请注意,它必须通过 Http 而不是 pop3 或 Imap(无论如何都不支持)。我需要它,因为我需要使用 pop3 会话不支持的 Http 代理连接到多个帐户。任何形式的帮助表示赞赏。
谢谢各位朋友=]
I am looking for a fast way or a library to check a hotmail inbox using HTTP. Note that it must be through Http and not pop3 or Imap(that is not supported anyway). I need that because I need to connect to several accounts using Http Proxies that is not supported in pop3 sessions. Any kind of help is appreciated.
Thanks buddies =]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
这可能不是您想要的,但您可以通过 http 建立 pop3 连接隧道。缺点是您需要在局域网之外的某个地方有一个可以连接的服务器。
下面是一个示例: Pop3 over Http
This is probably not what you are looking for, but you could tunnel a pop3 connection through http. The down side is that you would need a server somewhere outside your lan that you can connect to.
Here is an example: Pop3 over Http
不确定这是否有帮助:
Hotmail using C#
Not sure if this may help:
Hotmail using C#
尝试看看 WaTiN。
它是我们用来在 Web 应用程序上执行测试、模仿用户交互的框架。我们还使用 to 与 Mailinator 进行通信以检查虚拟电子邮件。
我很确定 WaTiN 可以在这里提供帮助,但缺点是它实际上会打开特定的浏览器,所以如果您可以忍受这一点,那就是正确的选择。
您还可以发出网络请求并提供正确的发布数据来执行登录,这实际上并不那么困难。之后,只需解析响应的内容以检查是否有电子邮件。
您过去可以使用 System.Net.mail 命名空间和邮件客户端直接连接到 hotmail 服务器,但我不确定 hotmail 是否仍然允许这样做。
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.
我相信,如果不模拟用户在浏览器中执行的操作,目前是不可能的。最简单的方法是使用“VS2010 Test Professional”或“VS2010 Ultimate”功能来记录浏览会话并生成具有相同功能的 C# 代码!请参阅 这里,它对我来说开箱即用,并且生成可以在应用程序中重复使用的可读代码
BWT,这些似乎是现有的 API:
- pop3.live.com,端口 995(需要 SSL)用于接收邮件;
- smtp.live.com,端口 25(无 SSL)或 587(SSL)用于发送电子邮件;
- Windows Live Messenger 联系人 API(旧版)允许访问联系人;
- Windows Live Messenger Connect 允许执行 Messenger 可以执行的任何操作;
- Windows Live Messenger 邮箱属性 允许查看邮件和未读邮件的数量;
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,但已经被淘汰了,官方声明如下:
继续 DAV 协议停用
Windows Mail 和 Windows Mail Outlook Connector 都使用名为 DeltaSync 的协议,该协议未记录。
有些人试图像这个人一样对其进行逆向工程:DeltaSync HU01 解压代码已发布,但是有绝对不能保证这不会发展 - 事实上,您可以确定这将会发展:-)
因此,您最好使用 POP3:Hotmail 和 MSN 帐户 POP3/SMTP 访问
There is no official way to read Hotmail using HTTP(S). There used to be DAV but this has been phased out, here is the official statement:
Continuing DAV protocol retirement
Windows Mail & Outlook Connector both use a protocol named DeltaSync that is not documented.
Some people are trying to reverse engineer it like this guy: DeltaSync HU01 decompression code released, but there is asolutely no guarantee this will not evolve - in fact, you can be sure this will evolve :-)
So, you're better off with POP3: Hotmail and MSN Accounts POP3/SMTP Access
您可以使用隐藏的 WebBrowser 控件。然后使用源代码捕获电子邮件标题等。
在这个答案我解释如何做。
我认为这是最简单的方法。
You could use a hidden WebBrowser control. And then use the source code to capture the email titles and all.
In that answer I explain how to do it.
I think it's the most easy way to do it.
您需要逆向设计 DeltaSync 协议。
使用32位版本的MS-Mail和oSpy捕获SSL数据包+Wireshark捕获http数据包。
You need to reverse-eningeer the DeltaSync protocol.
Use the 32-Bit version of MS-Mail and oSpy to capture the SSL packets + Wireshark to capture the http packets.