Wrong send date of the EML files

Hi,

I am using the latest version of Aspose.Email (3.0.0.0), but I am having a issue when I try to get the date from some eml files.

These EML files contains following dates:

-1 "Date: 16 4 2005 23:08:16"
-2 "Date: 16 4 2005 23:08:16 -0300"
-3 "Date: 16 Apr 2005 23:08:16"
-4 "Date: 16 Apr 2005 23:08:16 -0300"
-5 "Date: Tue, 16 Apr 2005 23:08:16 -0300"
-6 "Date: Tue, 16 Apr 2005 23:08:16 -0300 (CDT)"
-7 "Date: Tue, 16 Apr 2005 23:08:16"
-8 "Date: Tue, 16 Apr 2005 23:08:16 GMT"

This is the date that returns (Aspose.Email):

1- "0001-01-01 00:00:00.000" - Invalid date
2- "0001-01-01 00:00:00.000" - Invalid date
3- "0001-01-01 00:00:00.000" - Invalid date
4- "2005-04-17 02:08:16.000" - OK
5- "2005-04-17 02:08:16.000" - OK
6- "2005-04-17 02:08:16.000" - OK
7- "0001-01-01 00:00:00.000" - Invalid date
8- "2005-04-16 23:08:16.000" - OK

But, the previous version (Aspose.Network) returns the correct date that has the EML files:

1- "2005-04-16 23:08:16.000" - OK
2- "2005-04-17 02:08:16.000" - OK
3- "2005-04-16 23:08:16.000" - OK
4- "2005-04-17 02:08:16.000" - OK
5- "2005-04-17 02:08:16.000" - OK
6- "2005-04-17 02:08:16.000" - OK
7- "2005-04-16 23:08:16.000" - OK
8- "2005-04-16 23:08:16.000" - OK

When used the previous version (Aspose.Network 6.7.0.0), this issue does not happen.

This is the code I am using:

MailMessage message = MailMessage.Load("example.eml", MessageFormat.Eml);

Console.WriteLine(message.Date);

My test was performed using UTC time zone.

I attached some EML files to analyze it and reproduce this issue.

Please if there is something that you could do to fix this I'll really appreciate.

Regards,

Hi Gerardo,

We are sorry for a delayed response.

We are currently investigating this issue and will share our findings here as soon as possible. Your patience is highly appreciated in this regard.

Hi Gerardo,

Thank you for considering Aspose.Email as part of your solutions.

I was able to reproduce this issue at my end using the latest version of Aspose.Email for .NET 3.0.0 and have logged it in our bug tracking system under issue id: NETWORKNET-33891. Development team will look into it and once we have any information regarding the resolution of this issue, we'll update you here via this thread.

If you have any other query/inquiry regarding Aspose.Email, please feel free to post to us. We'll try to assist you further as soon as possible.

The issues you have found earlier (filed as NETWORKNET-33891) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi

We made some test with the versions 3.2.0 and 3.3.0 of Aspose.Email but we still have the issue.
The code:

Aspose.Email.License license = new Aspose.Email.License();
license.SetLicense("Aspose.Total.lic");
MailMessage mailMsg1 = MailMessage.Load(@"01-Example.eml", MessageFormat.Eml);
Console.WriteLine("01-Example.eml: " + mailMsg1.Date);

The result of test was same that version 3.0.0 that we posted in this thread.

Could you check if we are missing something in the code?

Thanks & Best Regards,

Hi,


Thanks for writing to us again.

It is observed that because not all dates correspond RFC2822, therefore messages should be loaded using FileCompatibilityMode.SkipValidityChecking flag as shown in the following sample code. Similarly some of the dates are different because GMT offset is not specified.

Could you please give a try to the following code which displays all the dates as shown in the attached image?

string[] files = Directory.GetFiles(@“Wrong send date”, “*.eml”);
foreach (string file in files)
{
try
{
//Load mail message
MailMessage message = MailMessage.Load(file, FileCompatibilityMode.SkipValidityChecking);
Console.WriteLine(message.Date);
}
catch (Exception ex)
{
Console.WriteLine(file);
Console.WriteLine(ex.Message);
}
}