The attached Email (.eml) cannot be converted to a MapiMessage.
(I am using the following code to convert a eml to msg file)
MapiMessage.FromEmailMessage throws an “The reply to address is not in a recognized format”
Code Snippet
- using (MemoryStream ms = new MemoryStream(Properties.Resources.Aspose_Total))
- {
- License lic = new License();
- lic.SetLicense(ms);
- }
- try
- {
- MailMessage emlMessage = MailMessage.Load("C:\\ErrorMail.eml");
- MapiConversionOptions saveOptions = new MapiConversionOptions();
- saveOptions.UseBodyCompression = true;
- saveOptions.Format = OutlookMessageFormat.Unicode;
- // The next line throws an Exception; Problem parsing the ReplyTo-Adresses
- MapiMessage mapiMessage = MapiMessage.FromMailMessage(emlMessage, saveOptions);
- }
- catch(Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }