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