Hello,
Hi James,
Could you please specify the format of message in MailMessage constructor. The above code will show date as 01/01/0001 because email is not loaded correctly in MailMessage class. The default format is eml.
It will work if you change the code as
MailMessage msg = MailMessage.Load(@“Test.msg”, MessageFormat.Msg);
Hello,
Hi,
FileCompatibilityMode.MostCompatible argument in the constructor was introduced to fix Subject related issues for “eml” files only.
All the below statements can load eml files correctly:
MailMessage msg = MailMessage.Load(“test.eml”, FileCompatibilityMode.MostCompatible);
MailMessage msg = MailMessage.Load(“test.eml”);
MailMessage msg = MailMessage.Load(“test.eml”, MessageFormat.Eml);
But for loading msg files, MessageFormat.Msg must be passed as an argument as below:
MailMessage msg = MailMessage.Load(“test.msg”, MessageFormat.Msg);