Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outlook 2007 changes link styles in a HTML email to have a blue underline when sent to Hotmail, Gmail, etc. Any fixes?

I've been using the HTML email templates that I obtained from http://www.campaignmonitor.com/templates/ And on every example I have gone through, when I send an email using the HTML template, all the links are given the horrible default blue underline. The emails are being sent using Outlook 2007 and when they are viewed in Outlook they are fine. However, in Hotmail and Gmail, this blue underline persists regardless of what color the text is.

I've tried inline styling of the a tag like so:

<a href="./" style="color: #E3A216; text-decoration: none;">Mauris commodo hendrerit risus</a>

If I use the exact same HTML email template code and send it from my hotmail account to another hotmail account it works perfectly. So, to me this is an Outlook 2007 issue.

I was able to dissect the html that outlook sends to the hotmail recipient and found that Outlook attaches a stylesheet on top of the HTML code. This is what it sends:

<style>
.ExternalClass .ecxshape
{;}
</style>

<style>
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{margin-bottom:.0001pt;font-size:11.0pt;font-family:'Calibri','sans-serif';}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p.ecxMsoAcetate, .ExternalClass li.ecxMsoAcetate, .ExternalClass div.ecxMsoAcetate
{margin-bottom:.0001pt;font-size:8.0pt;font-family:'Tahoma','sans-serif';}
.ExternalClass span.ecxEmailStyle17
{font-family:'Calibri','sans-serif';color:windowtext;}
.ExternalClass span.ecxBalloonTextChar
{font-family:'Tahoma','sans-serif';}
.ExternalClass .ecxMsoChpDefault
{;}
@page WordSection1
{size:612.0pt 792.0pt;}
.ExternalClass div.ecxWordSection1
{page:WordSection1;}

</style>

.ExternalClass seems to be setting the values for the a tag, but my inline styling doesn't appear to be overwriting what Outlook is adding to the email.

I've tried creating a stylesheet in the head section, and even in the body section, but this does nothing.

Does anyone know a fix for this? I either want rid of the underline, or even just have the underline display in the color I have specified for links.

Thanks to anyone who can help.

like image 837
C-g Avatar asked Nov 10 '10 16:11

C-g


People also ask

How do I get rid of the blue color in a link in HTML?

Set red color to the text using the hex code #FF0000 . Then, set the text-decoration property to none . The CSS below will set the text Next Page to red which is a hyperlink. The text-decoration property, which is set to none , will remove the underline and blue color of the element of the anchor tag.

How do you remove the underline from a hyperlink in an email?

Use text-decoration:none ! important; instead of text-decoration:none; to make sure you "lose" the underline.

How do I change the color of an email link in HTML?

To change the color of links in HTML, use the CSS property color. Use it with the style attribute. The style attribute specifies an inline style for an element. Use the style attribute with the CSS property color to change the link color.

Does Outlook 2007 support HTML and CSS?

Microsoft Office Outlook 2007 uses the HTML parsing and rendering engine from Microsoft Office Word 2007 to display HTML message bodies. The same HTML and cascading style sheets (CSS) support available in Word 2007 is available in Outlook 2007.

How to set up HTML email signature in Outlook 2007?

HTML email signature setup in Outlook 2007. 1. Open the Outlook 2007 E-mail Signature editor. You can do this either via Tools, Options, Mail Format tab, Signatures…: or by opening a new email, selecting the Insert tab, clicking the Signature button and then the Signatures… option: 2.

Why won’t my HTML emails work in Outlook 2007?

In short, unless your HTML emails are very, very simple, you’re going to run into problems with Outlook 2007, and in most cases the only solution to those problems will be to reduce the complexity of your HTML email design to accommodate Outlook’s limited feature set.

How to use tables and table backgrounds in Outlook 2007 Signature Editor?

By default the email signature editor in Outlook 2007 does not allow for using tables and table backgrounds. But it is possible to work around this limitation. Here is how to do it: 1. Open the Outlook 2007 E-mail Signature editor. You can do this either via Tools, Options, Mail Format tab, Signatures…: 2.


4 Answers

Update: This answer was correct at the time of writing in 2012 but doesn't seem to work anymore.

Wrap your text with a <span> tag with a style attribute.

You should also be using <font> to be extra careful.

For example:

<a style="color:#E3A216; text-decoration:none;">
  <span style="color:#E3A216;">
    <font color="#E3A216">
      Click me
    </font>
  </span>
</a>
like image 184
Alex Avatar answered Oct 07 '22 17:10

Alex


To get rid of the blue in Gmail just change the color from #000000 to #000001. Gmail makes all black links blue.

like image 40
Katy Avatar answered Oct 07 '22 17:10

Katy


You should not be using styles, inline or otherwise, in email templates. Deprecated code is the order of the day and the underline on the font is avoided by (in)correctly applying the font-colour declaration around the link itself, even if it is already inside a font declaration for the surrounding text. Example:

<font face="Arial, Helvetica, sans-serif" color="#ffffff" size="2">Some non link text here followed by <a href="http://www.yourlink.com" target="_blank"><font color="#ffffff"><u><em>the text for the link here surrounded by the font style specifically for the link</em></u></font></a> irrespective of the text that surrounds it</font>

Enjoy. HTML emails are very backward in the way that they have to be constructed in order to satisfy all email clients.

like image 29
Tony Hadley Avatar answered Oct 07 '22 17:10

Tony Hadley


Actually, inline-styles are the only way to style your text, but the best way is to declare it several times. Using the FONT-tag as mentioned above doesn't do the trick for all email clients.

The correct way to use the FONT-tag for HTML emails:

<font face="Arial, Helvetica, sans-serif" size="1" color="#333333" style="font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#333333">Example of styled text.</font>

The best way to style your text, is by doing as this:

<table cellpadding="0" cellspacing="0" border="0" align="center" width="600">
  <tr>
    <td width="600" bgcolor="#ffffff" align="left" style="font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#333333;">
      <a href="#" style="color:#333333; text-decoration:underline;"><span style="color:#333333;">Example of styled linktext.</span></a>
    </td>
  </tr>
</table>

I put an extra style in the head, which apply in Outlook (but not in Gmail):

<style type="text/css">
  a, a:link, a:visited { color:#333333; }
</style>
like image 28
Geert Avatar answered Oct 07 '22 19:10

Geert