Stop mail clients auto-linking text as URLs

Wow – it’s been a while since I last posted…

This is just a quickie – a reminder for my own reference, but could also be useful to others.

I’m building a shop, and the email confirmations include the line:

Your credit card statement will show a payment to "MYDOMAIN.COM".

Which is fine, except that many mail clients (e.g. Apple Mail) will take MYDOMAIN.COM and link it as a URL – which I don’t want.

To avoid this, simply add a zero width space into the “URL” – for instance:

Your credit card statement will show a payment to "MYDOMAIN​.COM".

(That’s the HTML version. If you’re generating a plain text alternative (using CFML, of course), you’ll want to use #Chr(8203)#).

The text will now look identical – except it will not be linked by the mail client.

Posted at 12:03 PM on 9 February, 2010, in Quick Tips, HTML

2 replies to “Stop mail clients auto-linking text as URLs”

  1. Adam Tuttle
    Great tip! Bookmarking this because I know I'll need it sooner or later...
  2. Sami Hoda
    Good stuff!

Leave a comment

Leave this field empty: