Prevent hyperlinks in HTML emails (namely Outlook)
Asked Answered
T

3

10

We've got some HTML emails that get sent out that show email addresses our service has blocked. When viewing the email in Outlook (and presumably in other clients as well) these plain-text email addresses get turned into clickable links that would compose a new message to this address when clicked.

Is there a way to prevent this from happening? Perhaps a meta tag with a flag that would prevent Outlook from converting these into clickable links?

Totaquine answered 11/1, 2011 at 19:51 Comment(3)
If you have these links/addresses blocked anyway, why do you care?Elyn
Not helpful. We don't want to have links everywhere, and they are all things you could accidentally click on to compose a new message. It's not something we want if we can avoid it.Totaquine
Does this answer your question? How to disable an email link?Bellanca
G
10

Most email clients strip out META tags, Javascript, and other types of code not necessary for email. Outlook is going to do what it wants with your email, so what you may want to do is wrap the addresses with your own anchor tag and use a blank HREF. Then, style the link to look like the rest of your text.

Germ answered 18/1, 2011 at 21:35 Comment(2)
Very good idea, I'll give that a shot! From what I remember though, Outlook seems to override my link colors with the default blue, so that's my only concern that this point. Thanks.Totaquine
I don't know why I didn't think of this. It works for me. I inline my styles in my emails and use the following css to style my 'empty links' so they look the same as normal text. The only downside is you can't seem to override the cursor: a[href=""] { text-decoration: none; color: #000; }Overlong
S
3

I think a better answer is to formulate anything that you think a mail client might try to generate a link for in a way that breaks up the string a bit like this: https://mcmap.net/q/491171/-prevent-url-39-s-from-appearing-as-links-in-mail-clients

Sailboat answered 8/1, 2013 at 23:34 Comment(1)
Hey Ryan, I like this solution of breaking the URLs into multiple spans. The problem is that it won't work properly in all email clients - e.g. Outlook 2007.Housley
U
-1

Add a dash or brackets to the link to prevent it turning into a hyperlink.

-https://www.example.com

[https://www.example.com]

Uncomfortable answered 30/7, 2024 at 13:44 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.