通过各种asp.net网页维护单个POP3连接? [英] Maintaining a single POP3 connection through various asp.net webpages?

查看:50
本文介绍了通过各种asp.net网页维护单个POP3连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在构建一个基于Web的电子邮件客户端,该客户端连接到pop3服务器(主要是Hotmail,但适用于任何服务器).我正在使用Lumisoft.net.dll,并且一切正常.关键是,我有一个页面可以用作登录,还有一个页面可以查看所有电子邮件(收件箱),然后还有另一个页面可以单独查看电子邮件.现在,每次我从页面切换到另一个页面并通过会话变量传递用户帐户和密码(我不建议这样做)时,我都会重新连接服务器并重新进行身份验证,因为我不知道如何声明pop3_client对象作为全局变量. Hotmail pop3服务器(pop3.live.com)限制了您在15分钟内可以连接到它的次数.如果我继续这样工作,则在阅读了几封电子邮件或刷新了收件箱后,服务器将关闭连接. 有没有一种方法,我可以只连接一次,然后在整个会话中使用相同的连接来检索和发送电子邮件,然后在用户注销时释放该连接?我很新到asp.net(和一般的Web编程),我知道这在桌面应用程序上会更容易,但是我似乎无法在这里找到它.我到处都在寻找答案,但找不到.提前谢谢.


这是我从服务器收到的错误: -ERR超过了15分钟的登录限制.减少对POP3服务器的请求频率.

Hi,

I''m building a web-based email client that connects to a pop3 server (mainly Hotmail, but should work for any server). I''m using the Lumisoft.net.dll and everything is working well. The thing is, I have a page that works as a log in, and a page to view all emails (inbox) and then another page to view emails individualy. Right now I reconnect and re-authenticate with the server every time I change from a page to another and pass the user account and password through session variables (not recommended, I know) because I don''t know how to declare the pop3_client object as a global variable. The Hotmail pop3 server (pop3.live.com) limits the amount of times you can connect to it in 15 minutes. If I continue working like this, after reading a few emails or refreshing the inbox, the server will shut the connection. Is there a way that I could connect just once and then use the same connection through out the session to retrieve and send emails, and then dispose the connection when the user logs off? I''m very new to asp.net (and web programming in general), and I know this would be easier on a desktop application but I just can''t seem to get it here. I''ve searched everywhere for answer but I can''t find it. Thanks in advance.


This is the error I get from the server: -ERR Exceeded the login limit for a 15 minute period. Reduce the frequency of requests to the POP3 server.

推荐答案



您应该将连接的POP3客户端对象存储到会话变量.
接下来的每个操作都使用连接的客户端.

确保POP3客户端不会自动从服务器断开连接的安全方法是使用NOOP命令.
您应先Noop,然后再尝试其他操作,如果noop失败,则应尝试重新连接.

另外,请确保在ASP会话过期时处置POP3客户端.
Hi,

You should store connected POP3 client object to session variable.
Each next operation uses connected client.

Safe way to ensure that POP3 client is not auto disconnected from server is to use NOOP command.
You should Noop before try another actions, if noop fails you should try to reconnect.

Also be sure that you Dispose POP3 client when ASP session is expired.


这篇关于通过各种asp.net网页维护单个POP3连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆