We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem to parse mail with 2 multiparts - one inside of other

Hi guys,

i face an issue with “strange” TWO multipart EML structure (please see attachment).
Email object can’t parse it correctly -> e.g. doesn’t see any LinkedResources.

Additionally when i save Email as MHTML and try to open as AsposeWords Document:

lEml.Save(lStreamMHT);
lStreamMHT.Position = 0;

Aspose.Words.LoadOptions lLoadOptions = new Aspose.Words.LoadOptions();
lLoadOptions.LoadFormat = Aspose.Words.LoadFormat.Mhtml;

Aspose.Words.Document lDocument = new Aspose.Words.Document(lStreamMHT, lLoadOptions);

I get following exception: Unsupported target content type in a multipart/related structure: text/plain.

Any idea?


Hi Ondrej,


Thank you for writing to Aspose Support team.

You can find the information about the linked resources in the alternate view of the EML file using the following code:

Sample Code:

MailMessage eml = MailMessage.Load(“761341\two_multipart.eml”);

Console.WriteLine(eml.AlternateViews[0].LinkedResources.Count);

For your other issue, we were able to observe the problem. Our fellow team member for Aspose.Words team will soon assist you in this regard.

Hi Kashif,
please, could you shortly explain the idea of AlternateViews?
I'm not sure how do i know where "attachments / linked resources" can be found?

Thank you!
Ondrej

Hi Ondrej,


If the LinkedResources collection of MailMessage is empty, you can check for these in Alternate views of the MailMessage API.
Hi Ondrej,

Thanks for your inquiry.
ondrej.hanak:
I get following exception: Unsupported target content type in a multipart/related structure: text/plain.
We have tested the scenario using latest versions of Aspose.Email for .NET 6.7.0 and Aspose.Words for .NET 16.6.0 and have not found the shared issue. Please use latest version of Aspose.Words and Aspose.Email.

Please let us know if you have any more queries.

Hi Tahir,

just downloaded the latest Aspose.Email 6.8.0 and Aspose.Words 16.7.0 and unfortunately i’m still receiving the same Exception: Unsupported target content type in a multipart/related structure: text/plain.

Any idea?

Best regards,
Ondrej
Hi Ondrej,

Thanks for your inquiry.

Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing. Thanks for your cooperation.

Hi Tahir,

here it comes…

Thank you!
Ondrej
Hi Ondrej,

Thanks for sharing the detail. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-14061. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-14061) have been fixed in this Aspose.Words for .NET 16.12.0 update and this Aspose.Words for Java 16.12.0 update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.