Get date and time of a mail message in outlook

Hello all,

I am trying to a log of the emails i received and put it to an excel file.

I am able to get the sender(assign mail.From.Address to string) and the text in the mail but how can I get the time and date of the mail message from outlook?

Hi @dvn

You can access headers of the email object like this : myMailVar.Headers("property") .

To have an exhausted list of the properties you can get from the headers, you can get them from this link (https://msdn.microsoft.com/fr-fr/library/system.net.mail.mailmessage.headers(v=vs.110).aspx).

Hope that helps.

Thanks

2 Likes

Hi @ksrinu070184

Try below code

mailMessage.Headers("Date")

1 Like