0 votes

How will you get the Received date and time from email?

by
Please use tags, subject and question body adequately.

1 Answer

0 votes

Emails don't store such time anywhere.

In the email itself you only have Date header (IMail.Date) which is
the send date (set by the client sending a message), and Received headers (IMail.Received) those headers are added by all SMTP servers that transfer the message.

If you are using IMAP, it assigns internal date when it receives the email for the first time.

You can access it using:

Imap.GetMessageInfoByUID (MessageInfo.Envelope.InternalDate)

-or-

Imap.GetEnvelopeByUID (Envelope.InternalDate)

It uses server's timezone.

by (270k points)
...