Free Support Forum -

Getting the sent and receive time from an existing .msg file

How can I use the to get the sent and recieve time for an existing .msg file? Thanks for yourself.


Thanks for considering Aspose.

The client's sent time can be retrieved by MailMessage.Date property.

The received date can be fetched from message headers. Its actually the message received at the mail server. You can get it using the following code snippet:

MailMessage msg = MailMessage.Load(@"test.msg", MessageFormat.Msg);

Console.WriteLine("Sent date: " + msg.Date);

Console.WriteLine("Received date: " + msg.Headers["Received"].ToString());

And what shall I do include to be it works?

Because VC# says me that MailMessages is not found.

Thanks, I have solved it myself!