How to prevent a URL in an email I send from being auto-linked by the recipient's email client?

6

When I type a URL into an email in Outlook, it automatically converts it to a hyperlink. I can, of course, remove the hyperlink from the context menu:

Outlook context menu screenshot

But, then when the email is received and when I view it in my Sent Items folder, the urls are again converted to hyperlinks. How can I prevent this? Embedded images are no good because the URL must be copy and pasteable (among numerous other reasons that this approach is not great). And it must retain the formatting applied when I send it.

This answer on stackoverflow shows a good trick for preventing auto linked urls when sending an email programmatically, but I'm looking for a way to do this from the UI. Perhaps there a way to edit the HTML of the message before it is sent?

If not, I guess I'm off to write an Outlook Add-in.

gilly3

Posted 2012-09-14T20:06:14.550

Reputation: 606

You can edit the HTML of the link before you send it. Just click the Edit Hyperlink... showed in your image there and then add the <z></z> tag within the hyperlink, as outlined in the SO answer you showed. – techturtle – 2012-09-14T21:17:37.140

@techturtle - Well, that's certainly better. It's still shows a hand cursor indicating the link is clickable. It also shows a tooltip saying "click to follow link" and exposing the faux html tag in the url. But it keeps the formatting I specified, and clicking on it does nothing. Thanks for the tip. – gilly3 – 2012-09-14T21:27:28.533

True. I added this as an answer so I could explain it a little better and so you could accept as answer if this what you end up going with. – techturtle – 2012-09-14T21:31:22.367

One comment on the OP: Why do you sent an email in HTML? I know some clients support this but not all receivers will be able to read your mail. And not using HTML but 'normal' email will at least make sure that you do not send it as a hyperlink. – Hennes – 2012-09-14T23:24:15.880

@Hennes - Two points: 1.) Have your really found HTML email incompatibility to be a problem? Which email clients today cannot display HTML formatted email? In my decades of emailing, I've not once heard from a recipient that they were unable to read my HTML formatted email. 2.) My email client automatically converts urls in plain text email messages to hyperlinks. – gilly3 – 2012-09-15T00:06:14.957

Aye, but I must admit I am using a rather old email client called 'elm'. (I started using it in 1991 and I still occasionally use it because it is quick, easy to use). I know at least half a dozen other people still using programs like elm and mutt. So I am not the last exception. – Hennes – 2012-09-15T00:13:45.600

Answers

1

You can edit the HTML of the link before you send it. Just click the Edit Hyperlink... showed in your image there and then add the <z></z> tag within the hyperlink, as outlined in the SO answer you showed.

Edit Hyperlinks

This has the advantage of showing up like a link, but attempting to click it does nothing. However, you are not prevented from selecting it to copy/paste.

Dummy link

The z isn't necessary; any invalid HTML tag will do. You could replace the whole link with something invalid, but then it would still try to open it in a browser. For some reason, having the invalid tag in the middle prevents it from even trying to open it even though it still knows it's a hyperlink.

techturtle

Posted 2012-09-14T20:06:14.550

Reputation: 8 059

Thank you. I can actually improve on this a little. Just replace the entire address with a faux tag, such as <Do not click>, or <->, or < > (with a space). The tool tip displayed removes the outer angle brackets, displaying just "Do not click", "-", or " " respectively. Change the formatting and you are set! http://i.stack.imgur.com/jvvbj.png

– gilly3 – 2012-09-15T00:38:19.393

Interesting. When I tested it earlier, I just put a as the hyperlink, but it tried to take me to http://a/. It failed, obviously, but I didn't that was what you wanted. Glad you found that out though. Could definitely come in handy. – techturtle – 2012-09-15T03:35:13.523

4

You can't prevent this (without somehow breaking the URL), because it's the recipient's client that displays the URL as a clickable link.

Ansgar Wiechers

Posted 2012-09-14T20:06:14.550

Reputation: 4 860

0

I've found that inserting a zero-width space in the URL works pretty well. For example, after the slashes and dots.

It prevents e-mail clients from formatting the text as links, but leaves the text copyable. See the difference:

It can be entered in Unicode as U+200B. For example on Ubuntu you can hit ctrl+shift+u then type 200b and space to enter it anywhere.

At first I thought this would break eventually, namely after pasting into the browser. But in Chromium the pasted link worked just fine (although the link was broken when the ZWSP was anywhere inside the http://). Even pasting a directory to Bash worked. Both the browser and the shell just ignored these zero-width characters.

Beware, that it probably will break something. For example, if pasted into a source code editor – you could end up with nasty bugs in your programs.

arekolek

Posted 2012-09-14T20:06:14.550

Reputation: 251