开发者

How do I stop Outlook from rendering an email address as a mailto: link?

I am creating an HTML email to be sent to a user. If there is a valid email address to within an HTML email, Outlook will render it (normally helpfully) as a mailto: link. Unfortunately, that's not the desired behavior in the particular email I'm sending.

How do I stop Outlook 开发者_开发百科from doing this?


Outlook doesn't recognize this pattern as an email: @[text]@[text].[text]

Thus adding before the email:

<a style="color: black; text-decoration: none"><font style="display: none">@</font>**email**</a>

and

<style>font {display: none}</style>

in the <head> tag will remove the mailto link.


I found your question through google, and hours later I found an answer that works for me for the same problem.

Wrap the email address inside an href with "#" as the target, and set the color to black and text decoration to none. Additionally, put the email address in another font tag, inside the anchor, with font size and type as well.

Like this:

<font face="Arial, Helvetica, sans-serif" size="1" color="#CCCCCC">
This e-mail was sent to 
<a href="#" style="color:#CCCCCC; text-decoration:none;">
<font face="Arial, Helvetica, sans-serif" size="1" color="#CCCCCC">
[email]</font></a>.</font>

The result is that the email address becomes a clickable link, but 1) it doesn't look like a clickable link and 2) the link doesn't go anywhere nor does it attempt to perform a mailto:

It's not perfect, but it's good enough for me for now.


Here is a solution which does not prevent emails from being turned into links, but it allows you to set the font color and remove the underline of that link.

It works in all email clients I tested in on litmus.com - including Outlook 2010, 2013, 2016 (also on Windows), Outlook.com, iPhone 6s, iPad, gmail web interface and Apple Mail 8, 9

Variation 1: A link which does not react when clicked upon

<a href="#" style="text-decoration:none; color:#000">bjorn@rosell.dk</a>

Variation 2: A mailto-link. Works in almost all clients. Outlook.com does however style it blue and with underline.

<a href="mailto:bjorn@rosell.dk" style="text-decoration:none; color:#000">bjorn@rosell.dk</a>

The @-hack offered by hallundbæk does not work on iPhone,iPad or gmail. And in gmail, the extra @ is displayed, which is not so cool.

The solution proposed by elbelcho is very similar to variation 1, but has additional font-tags, which turns out not to be neccessary.


I did it like this:

<span>username<span style="display: none;">@</span>@mail.com<span>

The parser was not able anymore to identify the e-mail and didn't add the "mailto" hyperlink.


Navigate to Tools > Options > Mail Format > Editor Options
Click on Proofing
Click on Auto Correct Options
Click on Auto Format tab and uncheck 'Internet and Networks path with hyperlinks'
Clikc on Auto Format as You Type and uncheck 'Internet and Networks path with hyperlinks'
Save and changes

(This solution is for Outlook 2007)


As far as i know there is no way to do it, but you could try writing the email in a way that outlook does not recognize (i.e. try replacing the @ by it's &# unicode representation).

I'm no outlook expert and i never had this particular problem so i would be interested in an easier way, too.


Can you put it in a <pre>whatever@address.com</pre> tag?


After trying all the valid solutions here, I came up with one on my own. For various reasons, none of the others worked, because I am required to achieve this result on all email clients, not just Outlook.

I added an invisible image spacer before and after the @ symbol as well as before the 'com'.

writehere@example.com

to

writehere<img class="nullsp" alt="" border="0" height="0" src="/spacer.gif" style="display:none; visibility: hidden; font-size: 0px; line-height: 0px" width="0"/>@<img class="nullsp" alt="" border="0" height="0" src="/spacer.gif" style="display:none; visibility: hidden; font-size: 0px; line-height: 0px" width="0"/>example.<img class="nullsp" alt="" border="0" height="0" src="/spacer.gif" style="display:none; visibility: hidden; font-size: 0px; line-height: 0px" width="0"/>com

Additionally I added a class (and this could be directed toward mobile):

img[class="nullsp"] { height:0px !important; width:0px !important; display:none !important; visibility: hidden !important;}

This fixed the issue in all email clients including gmail, yahoo and aol. The only issue is in outlook a tiny space is visible where the images would be, and if you copy and paste the address into a text editor, spaces appear.

A test in EOA shows this to work on most client/browser combinations that I tested: Safari, IE9, Chrome, Firefox; Gmail, Yahoo, AOL, MSN; Outlook, Android4. According to EOA, it still linked in Apple Mail6 and iPad2 and Iphone5 and 6; however on my own iPhone5 it did not link. And EOA is not famous for its accuracy.

I would appreciate anyone who could respond with a similar solution to the 4 devices I listed which failed.

~Libby


I have a similar desire to include URLs in email messages that are NOT rendered as links. I'm trying to discourage users from clicking links in email as a security measure, but I haven't yet found a way to tell them what to type (or cut-and-paste) into their browser without the information being rendered as a link. I think it would be OK to just leave off the "http : //"; however, my URLs tend to be https.


There is no way to do this. Outlook uses a text parser to look at the incoming email and if it finds something that matches its definition of an e-mail address (my guess is that it would be something like [text]@[text].[text]) then it adds a mailto: hyperlink on it.

This has nothing to do with the format you sent your mail in (text, RTF, or HTML). It also varies on the version of Outlook because it seems that Outlook 2007 is "smarter" at figuring out hyperlinks (both mailto and http) than 2003 is.

If you don't want the address to display as a link then I recommend either adding spaces to the text:

name @ company.com

or changing the @ sign to something that a human would understand but which Outlook would ignore:

name[AT]company.com

Or just tell your recipients not to click on it and see if they follow directions :)


after you paste the email, press backspace.


type the first few letters of the email address you want to get rid off like you are preparing to send an email to it. Outlook immediately proposes you a list of persons for which the address is similar. Click on the cross next to the adress that you want to delete, et voila. This is for Outlook 2010.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜