We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem in Received Time

Hi ,

I am using v5.3 of Aspose.Email to create Msg file. The time zone of my machine is UTC-8 (Pacific time). The message header in the output msg (attached in the post) shows 03:14 UTC-7, however when I check it in Outlook, there is difference in the Received time by 2 hours. Can you please check and advice as to what might be causing this problem?

Hi Jude,


thank you for writing to Aspose support team.

I have analyzed the MSG file by opening it in Outlook and checking its properties in MFC Mapi. For the sake of testing, I changed my system timezone to UTC-8(Pacific time). Following are the observations:

Outlook Time: 2008/12/21 02:40 PM
MFCMapi: 2008/12/21 10:40 PM
Header in Outlook: 2008/12/22 05:40 PM +05:30

MFCMapi shows the actual time, where as Outlook converts it according to local system time zone, however the Transport message header time is quite different.

This issue requires further investigation, therefore please assist us as follows:
1. Use latest library Aspose.Email for .NET 5.9.0 in your testing and let us know the feedback.
2. If issue is not resolved, please send us the source message file and conversion code using Aspose.Email. Better to send a console application which can be directly used to re-produce the scenario.
3.Describe the issue by providing some images of the comparison between the original source message and the converted message for our reference.

Here is the original MSG file.

Hi Jude,


We have analyzed your sample file by converting it to MHTML using our API. The output date time is same as that of the date header as you can see in the attached screenshot. Please note that Aspose.Email API considers the Date header for rendering date field to the output. MS Outlook, on the other hand, adjusts the date-time in display with the system timezone in consideration. If you need the displayed time information in output as well, please add the timezone information to message’s timezone information. Please share your feedback with us if you have further query about this issue.

Code:

string fileName = “DOCA000004850.msg”;

MailMessage msg = MailMessage.Load(“668847\” + fileName, new MsgLoadOptions());

Console.WriteLine(msg.TimeZoneOffset);

TimeZone localZone = TimeZone.CurrentTimeZone;

TimeSpan ts = localZone.GetUtcOffset(DateTime.Now);

msg.TimeZoneOffset += TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);

msg.Save(“668847\” + fileName + “.mhtml”, Aspose.Email.Mail.SaveOptions.DefaultMhtml);