How do you block emails from appearing as links in FreeMarker?

三世轮回 提交于 2020-01-06 04:35:17

问题


I'm working on some ftl templates and email addresses are coming through as links, specifically on mobile browsers and in Outlook.

Anyone know how to block this from happening?

Thanks in advance!

Note: I am not adding them as links, just the email itself.


回答1:


This is not a FreeMarker problem. Your using FreeMarker to simply generate HTML. If the HTML being produced is creating an HTML email link, then you need to modify template text, not any freemarker directive or setting.

I assume the template currently looks something like

<a href="mailto:${emailAddress}">Send Email</a> 

change it to just

${emailAddress}




回答2:


This has most probably nothing to do with Freemarker. What you are observing is an issue depending on how e-mail clients handle and display e-mails. Some clients just try to "help", identifying web and e-mail addresses etc. and then making them links.

Depending on the Mime type, different mail clients have different ways handling/displaying e-mails. Outlook e.g. sometimes does not display all attachments. It is anything but trivial to send out e-mails that display well in every mail client out there.

This thread on sevenforums.com states that you can trigger hyperlink replacement on or off in the options:

  • File > Options > Mail > Editor Options > AutoCorrect Options > AutoFormat tab > Replace > Internet and network paths with hyperlinks


来源:https://stackoverflow.com/questions/4275430/how-do-you-block-emails-from-appearing-as-links-in-freemarker

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!