Click here to Skip to main content
15,885,842 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

Edit:
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.
Posted
Updated 28-Mar-12 22:14pm
v2

1 solution

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.
 
Share this answer
 
Comments
Vic91 30-Mar-12 3:19am    
Thanks, I'll give this a try! I though about this but I just wasn't sure what sort of objects where allowed to be saved in the session variables.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900