Update: ReceivedDate
property has been added to Pop3MessageInfo
in Rebex Secure Mail 2016 R2.
The ReceivedDate
value is not part of the message itself. It's only a part of the IMAP protocol's message metadata (it's actually called INTERNALDATE
). The POP3 protocol doesn't provide any equivalent functionality, which unfortunately means that it's not possible to retrieve this using POP3 clients.
However, it is possible to retrieve a date from the topmost Received
header, which should more-or-less correspond to the ReceivedDate
obtained using Imap.GetMessageInfo
. The MailMessage
object can be used to easily parse the headers and return the desired date:
Pop3MessageInfo info = pop3.GetMessageInfo(sequenceNumber, Pop3ListFields.FullHeaders);
var mail = new MailMessage();
foreach (MimeHeader header in info.Headers)
{
if (header.Name == "Received")
mail.Headers.Add(header);
}
MailDateTime receivedDate = mail.ReceivedDate;