• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

General question how does email client knows about incoming mail?

 
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
ben josh
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic