View email along with the attachments using C#

Hello,

When converting an email (msg) to PDF using GroupDocs.Viewer (19.12.1), images are the only attachments that get converted to PDF as well.
The GroupDocs.Viewer is capable of handling so many formats, why are only image files converted?
Is there a way to control the behavior and is this somewhere documented?

At the moment I would have to guess / assume that I have to call SaveAttachment and tell the Viewer to convert everything that is not jpeg, jpg, png or bmp… which is not great.
Could this please be improved?

image.jpg (468.0 KB)

I was testing how the Aspose Email Viewer handles an email with a jpeg, a pdf and a docx attachment, but it was also not satisfactory.
Like in the GroupDocs Viewer, only the image was included in the conversion and when scrolling further down, conversion for the attachments was triggered later, leading to a duplicate image and was failing for the other two attachments for an unknown reason.

@Clemens_Pestuka,

Please share following details, we’ll then investigate this scenario:

  • Problematic email (msg) file with attachments
  • Sample code that you are using

Do you mean 19.12?

@atirtahir3
Thank you for taking a look at this issue.

Yes, I also tried with 20.1 now, but nothing changed.

I could not upload the same msg file due to upload size limitations, but it happens with any email:
Inconsistent behavior handling email attachments.zip (2.7 MB)

I was using the Basic PDF Render sample for converting the msg file.

1 Like

@Clemens_Pestuka,

This issue is reproduced at our end. Hence, we’ve logged it in our internal issue tracking system with ID VIEWERNET-2306. As there is any update, you’ll be notified.

1 Like

@Clemens_Pestuka,

Please note that this is API’s default behavior. You cannot render attachments in the source email file.

We will disable rendering of image attachments to avoid confusion. So, next time your will render an email message the output PDF/HTML won’t contain image attachments.

To render email attachments it is necessary to save attachment first with SaveAttachment method and render it with new instance of Viewer class.
Please check this example that demonstrates how to render email attachments.

@atirtahir3
Thank you for taking care of this issue :slight_smile:

Actually it would be even better / more important for us, if the Converter,
which already ignores the attachments and only converts the email,
would offer “EmailOptions” like the viewer for translating subject, sender,…

We would need this EmailOptions for PdfConvertOptions as well as for ImageConvertOptions.
Would it be possible to add this?

1 Like

@Clemens_Pestuka,

We are investigating this. You’ll be notified about the outcomes.

1 Like

@Clemens_Pestuka,

GroupDocs.Viewer for .NET doesn’t support such Classes. However, PdfConvertOptions and ImageConvertOptions are available in GroupDocs.Conversion for .NET API.

@atirtahir3

Thank you for the reply, unfortunately it looks like there is some misunderstanding.

GroupDocs.Viewer for .NET doesn’t support such Classes.

Maybe I wasn’t clear enough, so I’ll explain one more time what we want to achieve:

However, PdfConvertOptions and ImageConvertOptions are available in GroupDocs.Conversion for .NET API.

I know that they are available there and they are great and currently in use in our software :slight_smile:.
What we would love to have additionally for those classes, are the EmailOptions which are only available in the Viewer.
When we’re currently using PdfConvertOptions or ImageConvertOptions with the Converter, we cannot rename the email fields.
It would really be great if this could be added, as english email fields are just a no-go for a multi language application :neutral_face:

@Clemens_Pestuka,

We’ve raised your concerns here in appropriate forum category (GroupDocs.Conversion). Furthermore, VIEWERNET-2306 has been fixed in GroupDocs.Viewer for .NET version 20.2.