General question how does email client knows about incoming mail?
Joined: Apr 27, 2006
Hello all ( im not sure this is the right form ,sorry) i need to write simple client that connects to the email server and will know when serten email massage is arriving , my question is how does the ordinary email clients works and know that email are arriving ? i have the code and every thing but i miss the way to how to implement this part . i dont know if the idea of connection every N seconds to the email server will be the right idea. does they check every N seconds the server or they have some of other method to do this?
Joined: Jul 11, 2001
Originally posted by Meir Yan: i dont know if the idea of connection every N seconds to the email server will be the right idea. does they check every N seconds the server or they have some of other method to do this?
That's exactly how they do it (it's called "pulling") - although it's probably a better idea to do it every couple of minutes instead of seconds. Most email clients allow you to configure the interval.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Yes, please default to a few minutes, maybe 10 or 15, rather than seconds. For users with broadband, always on connections, it doesn't really matter, but its a waste of server cycles, people just don't get mail that frequently.
On networks that are not constantly on, and especially those that charge per connection, you want be frugal with the connections. Back in the mid 1990s, on ISDN, the telco charged a nickel (5 cents) for every start of the connection. One salesman was unaware, and set his mail check to every minute and ran up hundreds of dollars worth of billing.
In more modern times, the connection is likely to be cell phone or other network, and they too have strange charging algorithms.
Joined: Apr 27, 2006
Hi and thanks for the fast reply Well in my scenario (which I don�t sure what is the best way to implement it). My pop3 client need to know when incoming mail with define subject is arriving and perform action So I guess in my case the client needs to sample the email server every N seconds. I'm using home idsl connation. But you mention somkind of connection pool limit, so I guess I need to keep persistent connection to the email server And query every N seconds about incoming mails Is this the right way ?