Aspose.Email SDK Version 6.9 is not able to load eml throw parse date exception

Hello Team,

We are getting one problem with Aspose.Email SDK (.NET C#) and currently we are using latest version v6.9 for create (.pst) Microsoft Outlook file.

When we load particular eml file it throws an exception as follows :

String was not recognized as a valid DateTime.
ERROR2016-11-15 11:55:00 - Stack Strace :: at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
at System.DateTime.ParseExact(String s, String format, IFormatProvider provider, DateTimeStyles style)
at #=q8fOiGIxNRW4AudVLrngx5R6ByuXndDjl7LztenpvAIjoF_6ci3ceoUCFJSa60JTG.#=q0flpHkS5ebIClasnQCAtBw==(String #=qaUvwXhAEBV4Ndba3SIsQCA==)
at #=q8fOiGIxNRW4AudVLrngx5R6ByuXndDjl7LztenpvAIjoF_6ci3ceoUCFJSa60JTG..ctor(String #=qLFBhHgbEgNJPoFOFFTYQ_Q==, #=qgtRyQKx7OQxfI0zqYEwvhjc1XpwOQmNxE1daH6OA09JQhb_cK07J2ZmVILN3shFI #=qdMRrH3OaVbQOoRlkQXXV$w==)
at #=qX64TTR6y84hPjoI5UL$AgQpJcTspwsWXyDcD4RotwLFd8Jbryzr5ivBOx$a1k_Sy.#=q9uhk4tYbjljxBSdb7drCOg==(String #=qg0BQuKE6usYkYo23UMFimg==)
at #=qrs80eS8nFtqO04ah8r_QH4KHaZsYq5WcODx3RIZ8aVVZ8U4hZfIT39r7JiyR4tPi..ctor(#=qVtvdet8cnVUCFl3n6592Lmqjbd5hDKIROKhm7PwRc3H6sjb1cKcIvyGh9L4vxBUA #=q2OZCy1ONF9RfJ1OivBOgcg==, String #=qS4ZAa$rwIbRvI$x6wCWkWg==)
at #=ql6tpFI5DjpVB$oUV2kjHauwaKVJazNcwnFjgyhuGz8GTvL7ARZc0CHV0dt4lZh_r.#=qayyGTMw9HdDF3E0XZv1V7A==.#=qx9RrwUu$RnQUr5nIg1zOLA==(String #=qVIbz7rGm1AspIKNx8xQtIw==, #=qVtvdet8cnVUCFl3n6592Lmqjbd5hDKIROKhm7PwRc3H6sjb1cKcIvyGh9L4vxBUA #=qqb3WhW46_FHp2R$CLFqENQ==, String #=qg0BQuKE6usYkYo23UMFimg==)
at #=ql6tpFI5DjpVB$oUV2kjHauwaKVJazNcwnFjgyhuGz8GTvL7ARZc0CHV0dt4lZh_r.#=qx9RrwUu$RnQUr5nIg1zOLA==(String #=qVIbz7rGm1AspIKNx8xQtIw==, #=qVtvdet8cnVUCFl3n6592Lmqjbd5hDKIROKhm7PwRc3H6sjb1cKcIvyGh9L4vxBUA #=qqb3WhW46_FHp2R$CLFqENQ==, String #=qLFBhHgbEgNJPoFOFFTYQ_Q==)
at #=qLTzdLyrwvDazn61SZavUCk78Jc0ILosrS1LjPARnm2_cQTRGc1NLzIlKknyQZ4m4Tu7LENz9_2B6_TqKrVIewg==.#=qQZcrDjTyMoQcynBKUsqB6Q==(List`1 #=qe_OlQ17T5J$gHIHFbn61eg==)
at #=qb5_dC3bPySlc2wjHEpariH_pb6GdAlY$ge6gNaHVv9M1UX1FSP45Ww735vAeBULo.#=qXZ$uz4aalF9TT0OUrGYcXX_PpPgG7b6T9bB1ygr8jAQ=(Stream #=qvbMq_iGkiKD0mYR$7lzWvg==, Boolean #=q_$8qas8KMsxQ7bspMn_7ng==)
at #=qb5_dC3bPySlc2wjHEpariH_pb6GdAlY$ge6gNaHVv9M1UX1FSP45Ww735vAeBULo.#=qfTLky1yLZBrDZi9RlbHhPT4VLEtnqkSu$yYfWJoDC7E=(Stream #=qvbMq_iGkiKD0mYR$7lzWvg==)
at Aspose.Email.Mail.MailMessage.#=qS2w6wXzDyqZOUGTiacTWEGHxaS2UxqrRuRV9yFzjyJg=(#=qXaToUq5lHysLnpZYVG03Mglzwe4m$VgVqu_x8c4krHs= #=qfxXHoQZ8BylLatpM6ULEMw==, Boolean #=qP9bbLCdzk8th9dwcWoJz7w==, AlternateView #=qpLJXT$XzpPOGpRZsuHgd_Q==)
at Aspose.Email.Mail.MailMessage.#=qZ3l4mCL4Ygrh8V03AWiG_A==(#=qkH3IUnvbXUIOfJ1ST_d_$a0vq3E7l2sc7jhOK5CsPYY= #=q_dt9hNhs6_rC8nKHKLv$Rg==)
at Aspose.Email.Mail.MailMessage.#=qkvaQzMfM$ipPIXyGizyYfwvgt6D$RkipOA7oJ2SZPBc=(#=qkH3IUnvbXUIOfJ1ST_d_$a0vq3E7l2sc7jhOK5CsPYY= #=q_dt9hNhs6_rC8nKHKLv$Rg==)
at Aspose.Email.Mail.MailMessage.#=qlLF_Az7OaUMiyIJmcS55axYd3SZQGMmGrvytT1ZNxTs=(#=qkH3IUnvbXUIOfJ1ST_d_$a0vq3E7l2sc7jhOK5CsPYY= #=q_dt9hNhs6_rC8nKHKLv$Rg==, Boolean #=qCE9KUnYFsv3fV9R92il4tw==)
at Aspose.Email.Mail.MailMessage..ctor(#=qkH3IUnvbXUIOfJ1ST_d_$a0vq3E7l2sc7jhOK5CsPYY= #=q_dt9hNhs6_rC8nKHKLv$Rg==, Boolean #=q1Q9yc9InmFKbS0jff1$Jig==, Boolean #=qCE9KUnYFsv3fV9R92il4tw==)
at Aspose.Email.Mail.MailMessage.#=q8eebjUf7iQ_hjTA06iE7tQ==(Stream #=qvbMq_iGkiKD0mYR$7lzWvg==, EmlLoadOptions #=qjMcb3iJTvAzz14_U7T9wKQ==)
at Aspose.Email.Mail.MailMessage.#=qXfnRi634rnjnZbGDdmKvv$3fbz6xewLG2aPAuReUF0g=(Stream #=qvbMq_iGkiKD0mYR$7lzWvg==, LoadOptions #=qjMcb3iJTvAzz14_U7T9wKQ==)
at Aspose.Email.Mail.MailMessage.Load(String fileName, MailMessageLoadOptions options)

There is nothing suspious in the date time, i've check the eml date there is nothing wrong in it.

and if you are requesting for that sample, i'm afraid i can give it in as its of one of our client, but i can provide you the message header information here :

========================================================================================================

MIME-Version: 1.0
Date: Tue, 04 Jan 2005 15:27:23 +0530
Message-ID:
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
X-Priority: 3 (Normal)
X-Mailer: Chilkat Software Inc (http://www.chilkatsoft.com)
Return-Path: UNKNOWN@ABC.COM
To: UNKNOWN@ABC.COM
From: UNKNOWN@ABC.COM
CKX-Bounce-Address: UNKNOWN@ABC.COM
Subject: XXXXXXXXXXXXXXXXX

==========================================================================================================

Appericate your help, looking forward to hear you.

Thank You.

Regards,
Amit

Hi Amit,


Thank you for writing to Aspose Support team.

We have tested this issue with your specified header information (by copying it in a text file and saving it as .eml) and the latest version of the API i.e. Aspose.Email for .NET 16.11.0 but were not able to reproduce the problem at our end. The email is loaded fine using the new API. Please try it with this latest version and if the issue still persists, please share your sample EML file with us for our analysis and investigation.

Hello Kashif,


I was able to reproduce the issue with the help of client sample that i’ve create tested with Apose Email version 6.9

Here is the code :

class Program
{
static void Main(string[] args)
{
string f_tmpEmlPath = @“C:\sample.eml”;

MailMessageLoadOptions options = MailMessageLoadOptions.DefaultEml;
options.FileCompatibilityMode = FileCompatibilityMode.SkipValidityChecking;
try
{
MailMessage f_Objmailmessage = MailMessage.Load(f_tmpEmlPath, options);
}
catch (Exception ex)
{
}
}
}

It throws the same exception as mentioned in my earlier response.

And please find the sample in the attachment.

Can you please take this on priority as we are at the verge of release.

Looking for positive response.

Really appericate your help.

Regards,
Amit


Hi Amit,

This issue is re-produced with Aspose.Email for .NET 6.9.0 however no support is provided for the older versions. I have tested it using following sample code with the latest version Aspose.Email for .NET 16.11.0 and found no issue. You may please use this latest library to resolve this issue. Please give a try to the following sample code and share the feedback.

string f_tmpEmlPath = @"sample.eml";
MailMessage msg = MailMessage.Load(f_tmpEmlPath, new EmlLoadOptions());