Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jan : Re: how to retrieve messages from a mailbox in the sent order?

www.cryer.info
Managed Newsgroup Archive

Re: how to retrieve messages from a mailbox in the sent order?

Subject:Re: how to retrieve messages from a mailbox in the sent order?
Posted by:"Michael Stieler" (michael.stiel..@rie.eu)
Date:Tue, 22 Jan 2008 13:02:22

Iliya schrieb:
> sometimes depending or pop3 server when downloading messages by their mesage numbers, the messages are received not in the sequence they were sent.  sometimes message number 1 would even corespond to first message and sometimes to the last message.
> 1.how to figure the correct order to retrieve the messages?
> 2.how to sort retrieved messages in the order they have been sent?
>

1. I don't know if pop3 supports such a feature BUT
as for 2., a message sent to your pop3 server/account is usually
timestamped. You can read this timestamp from the Date field of the
message header.

It looks like:
From: "Sender Name" <test@yahoo.de>
To: test@gmx.eu
Date: Mon, 21 Jan 2008 11:41:43 +0000
[..]

If you parse this date you could should be able to sort the mails by
sending time (=the order they have been sent).
This would be independent of your pop3 server, but wouldn't work for
mails that were send at the same second.

Michael

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive