Environment:
- Aspose.Email.dll 16.10.0.0
- email client Outlook 2016 with Exchange Server
- timezone UTC+01
Test steps:
- make a new email and send it to yourself
- save the received email as an msg file - see file demo.msg in attachment
- try to convert the demo.msg file to pdf
Test code:
MailMessage msg= MailMessage.Load(“c:\temp\demo.msg”);
MhtSaveOptions mailSaveOptions = SaveOptions.DefaultMhtml;
mailSaveOptions.MhtFormatOptions = MhtFormatOptions.None | MhtFormatOptions.WriteCompleteEmailAddress | MhtFormatOptions.WriteCompleteFromEmailAddress | MhtFormatOptions.WriteCompleteToEmailAddress | MhtFormatOptions.WriteCompleteCcEmailAddress;
MhtMessageFormatter mailFormatter = new MhtMessageFormatter();
mailFormatter.FromFormat = "<span class=“headerLineTitle”>Von:<span class=“headerLineText”> {0}
"; //Wichtig: korrekte Anführungszeichen " benutzen
mailFormatter.DateTimeFormat = “dd.MM.yyyy HH:mm”;
mailFormatter.SentFormat = “<span class=“headerLineTitle”>Gesendet:<span class=“headerLineText”> {0}
”;
mailFormatter.ToFormat = “<span class=“headerLineTitle”>An:<span class=“headerLineText”> {0}
”;
mailFormatter.SubjectFormat = “<span class=“headerLineTitle”>Betreff:<span class=“headerLineText”> {0}
”;
mailFormatter.BccFormat = “<span class=“headerLineTitle”>Bcc:<span class=“headerLineText”> {0}
”;
mailFormatter.CcFormat = “<span class=“headerLineTitle”>Cc:<span class=“headerLineText”> {0}
”;
mailFormatter.AttachmentFormat = “<span class=“headerLineTitle”>Anlagen:<span class=“headerLineText”> {0}
”;
mailFormatter.Format(msg);
msg.Save(“c:\temp\demo.mht”, mailSaveOptions);
Aspose.Words.LoadOptions loadOpt= new Aspose.Words.LoadOptions();
loadOpt.LoadFormat = LoadFormat.Mhtml;
Aspose.Words.Document doc = new Document(“c:\temp\demo.mht”, loadOpt);
doc.Save(“c:\temp\demo.pdf”, SaveFormat.Pdf);
In the pdf document the timestamp is 08:35 but it schould be 09:35.
Same observations:
- the error is caused by the *.msg to *.mht conversion
- the error doesn’t occur when you try an email wich was sent by another person
- maybe the error is the same as in https://forum.aspose.com/t/20705