I am currently using GroupDocs.Viewer for .NET to render and view email (msg) files. However, I have encountered an issue: when viewing emails, any hyperlinks within the email body appear as plain text and are not clickable hyperlink.
Could you please advise if there is a way to enable link-clicking functionality or if any configuration or rendering option is needed to support interactive hyper links within the email body?
Hi @prapapra
You have not specified this, but I’m guessing that you’re trying to render the input MSG to the HTML format using HtmlViewOptions class. In that case, if my assumption is correct, please set the RemoveJavaScript flag in the HtmlViewOptions instanced to the false value. More on that here.
If my assumption was not correct, or this advice did not help, please share a piece of the source code, which you’re using to render the MSG, and the file itself, so we can investigate on our side.
With best regards,
Denis Gvardionov
Hi @denisgvardionov,
I’m using the code from GitHub: GroupDocs.Viewer-for-.NET/Demos/ASP.NET Web Forms/src at master · groupdocs-viewer/GroupDocs.Viewer-for-.NET · GitHub — you can download and test it yourself.
I’m not sure where exactly I should set RemoveJavaScript=false in the project. Could you please guide me?
BRs,
prapapra
@prapapra
Ah, so you’re using not the pure GroupDocs.Viewer library, but the GroupDocs.Viewer AspNetWebForms demo, got it.
In order to enable links, please go to the:
GroupDocs.Viewer.AspNetWebForms.Core.Viewers.HtmlWithEmbeddedResourcesViewer
GroupDocs.Viewer.AspNetWebForms.Core.Viewers.HtmlWithExternalResourcesViewer
And in the method protected override Page RenderPage(Viewer viewer, string filePath, int pageNumber) insert the new line viewOptions.RemoveJavaScript = false; right under the existing:
var viewOptions = CreateViewOptions(pageStream); for HtmlWithEmbeddedResourcesViewer class,
var viewOptions = HtmlViewOptions.ForExternalResources(streamFactory, streamFactory); for HtmlWithExternalResourcesViewer class.
If this will not help, please share the input MSG file.
With best regards,
Denis Gvardionov
Hi @denisgvardionov ,
I attempted to resolve this by implementing the recommended setting: viewOptions.RemoveJavaScript = false
However, this setting did not solve the problem, and the links remain unclickable.
For comparison, we have attached an image showing how the same email appears in Outlook (where the link is active) versus how it is rendered in GroupDocs.Viewer (where the link is not functional).
OpenLink.png (62.5 KB)
Best Regards,
Prapas
@prapapra
Hi Prapas,
I see, thanks for the screenshot. Is it possible for you to share with us the sample file, so we can check it on our side? If it has confidential info, you can send it me through the email at denis.gvardionov@aspose.com
With best regards and waiting for the reply,
Denis Gvardionov
@denisgvardionov
Hi Denis,
I have sent the sample file directly to your email as requested. Please let me know if you need any additional details.
Best regards,
Prapas
@prapapra
Hi Prapas,
I confirm that I’ve obtained the EML file via email and already sent it to our developers for the investigation. I’ll let you know when they will share some news or plans about it.
With best regards,
Denis Gvardionov