Outlook / .msg files not rendering in groupdocs version 17.2.2


#1

Outlook / .msg files fail to render in groupdocs viewer for .net version 17.2.2 . Also the style.css generated for .msg files include styles for body too. This hampers the css of the entire web page. Any help on this is appreciated.


#2

@Hardik_K,

Thanks for using GroupDocs.Viewer for .NET. Would you please share with us the problematic .msg file? We look forward to your response.


#3

Hi Team,

Kindly find the .msg extension file from the zip attached.Test File.zip (13.4 KB)


#4

@Hardik_K,

Thanks for providing the problematic file. We would request you to please re-check the version of GroupDocs.Viewer for .NET you are using as version 17.2.2 does not exist. We look forward to hearing from you.


#5

We are using version 17.2.0.0, let us know if any more information required. Thanks!


#6

@Hardik_K,

Thanks for your response.

We tested your provided .msg file with GroupDocs.Viewer for .NET 17.2.0 but unable to reproduce the issue. Please download the output files for your reference. In case you are getting any exception, please share with us the details. We also recommend you to upgrade GroupDocs.Viewer API to its latest version for a better experience.

In that case, you can try to use an iframe to load the HTML files generated by GroupDocs.Viewer as shown in below code sample.

<iframe src="output.html" frameborder="0">

Hope it helps.


#7

We are using groupdocs inside a div and it works for all other file types except for .msg.
We cannot use IFrame just for .msg.
The dll tries to find folder(message.msg) for css whereas the actual folder name is message_msg. This gives a 404 error and the .msg file does not render. If we somehow fix this , the styles in style.css are written even for body tag and this disrupts the css of my entire web page.


#8

@Hardik_K,

Thanks for providing the details. Would you please share with us the source code you are using to render .msg file? It will help us to reproduce the issue at our end. We look forward to hearing from you.


#9

The code breaks for .msg files in GetHtmlPages method ,basically the following code snippet :
var needResave = false;
if (text.IndexOf(ViewerConstants.RESOURCE_URL_ORD, StringComparison.Ordinal) >= 0 &&
text.IndexOf(ViewerConstants.RESOURCE_URL_DOC_ORD, StringComparison.Ordinal) < 0)
{
needResave = true;
text = text.Replace(ViewerConstants.RESOURCE_URL_ORD, string.Format(ViewerConstants.RESOURCE_URL_DOC_MAIN, urlPath, page.PageNumber));
}

                if (text.IndexOf(ViewerConstants.RESOURCE_URL_ORD_A, StringComparison.Ordinal) >= 0 &&
                    text.IndexOf(ViewerConstants.RESOURCE_URL_DOC_ORD_A, StringComparison.Ordinal) < 0)
                {
                    needResave = true;
                    text = text.Replace(ViewerConstants.RESOURCE_URL_ORD_A,
                        string.Format(ViewerConstants.RESOURCE_URL_DOC_MAIN_A, urlPath, page.PageNumber));
                }

                cssList.Add(text);

                if (needResave)
                {
                    var fullPath = Path.Combine(GetCachePath(id), filePath, ViewerConstants.HTML, ViewerConstants.RESOURCES,
                        string.Format(ViewerConstants.PAGE0, page.PageNumber), resource.ResourceName);

                    System.IO.File.WriteAllText(fullPath, text);
                }

#10

@Hardik_K,

Thanks for your response. The code snippet you shared with us shows that you are using one of the Showcase applications of GroupDocs.Viewer for .NET. In that case, please mention the name of the application. We look forward to hearing from you.


#11

GroupDocs.Viewer-for-.NET-master --> ASP.NET_MVC_Front_End project is referred for groupdocs .msg issue


#12

@Hardik_K,

Thanks for providing the required information. We have tested your scenario at our end but unable to reproduce your reported issue in ASP.NET_MVC_Front_End using GroupDocs.Viewer for .NET 17.2.0 and the email file is loading without any issue (see this). We recommend you to please download the latest source code of ASP.NET_MVC_Front_End from here. Hope it helps.


#13

outlookfileerror1.JPG (58.4 KB)
outlookfileerror2.JPG (56.9 KB)
We are facing the similar issue. Kindly refer the attached screenshots.


#14

@Hardik_K,

Thanks for your response. We are able to reproduce your reported issue using GroupDocs.Viewer for .NET 17.2.0. However, it was fixed since version 17.3.0. We would recommend you to upgrade your application to use the latest version of GroupDocs.Viewer for .NET. Furthermore, we have already added a workaround to handle this issue (for v17.2.0) in ASP.NET_MVC_Front_End (see this). You can download the updated source code from GitHub repository.