A question on e-mail program's - programming

I'm new to delphi and want to write an e-mail program as a project to
learn the Delphi language.
I'm hoping that someone can answer this for me...
How does an e-mail program know which mail has been precious read from
the server ?
I want to be able to only read new mail each time I access the server.

regards Brian