ViewerHtmlHandler.GetPages() throws ArgumentException for email with email attachment


When we try to generate the viewer cache for the attached test email (from Microsoft Office) ViewerHtmlHandler.GetPages() throws ‘System.ArgumentException’ with Additional information: Please provide file name with extension e.g. document.doc

email with email (22.1 KB)

The email contains a single attachment which is another email. The attachment doesn’t have a file type because the attached email has no extension - see the contents of the Attachment object returned from ViewerHtmlHandler.GetDocumentInfo():

- attachment {GroupDocs.Viewer.Domain.Attachment} GroupDocs.Viewer.Domain.AttachmentBase {GroupDocs.Viewer.Domain.Attachment}
DocumentType “Unknown” string
DocumentTypeFormat “Unknown” string
Extension “” string
FileType “Undefined” string
ID “I am the attached email” string
Name “I am the attached email” string
Size 42600 long
SourceDocumentGuid “ with email attachment.msg” string

This is with .NET GroupDocs.Viewer.dll version 18.10.

I was the ViewerHtmlHandler.GetDocumentInfo() to be able to detect that the attachment is an email (rather than DocumentType=Unknown). This attachment was added within Microsoft Office by dragging the second email into the email editor. Outlook only adds a .msg extension when you save an email - not when you attach an email to an email without saving it first.

Please advise on how to get the viewer to handle this situation.




Thanks for contacting support.

We are able to reproduce your reported issue when rendering the email attachment without having the extension. We have logged this behavior at our end as VIEWERNET-1549 for further investigation. We shall keep you informed in case of any updates.



The issue you have faced earlier (logged as VIEWERNET-1549) has been fixed in this release.


Thanks Usman. I can confirm that our viewer is now rendering these emails fine.



Thanks for the confirmation.