Anchor tags not working in Outlook?

I have a client that is reporting a problem with the anchor tags in an email I created when its viewed in Outlook 2007. It appears that they only work when the email is saved out on their computer. These are the typical "table of contents links to story below" variety:

<A href="#story1">Read more&nbsp;&raquo;</A>

Then further down in the email:

<a name="story1"></a>This is Story 1

Any ideas or suggestions?

Stig Stig, 9 years ago

This works in older Outlook versions. So if you're right about it not working in Outlook 2007, it's just one of many concequences of Microsoft switching Outlook to the Microsoft Word rendering engine.

I can't see how you can possibly work around this - if it's not supported, it's not supported.

Hopefully, not too many of your clients' subscribers have to live with Outlook 2007's HTML rendering. And hopefully, those who do know how to scroll. ;)

The Campaign Monitor Blog – HTML email smarts to go with your good looks.
MercuryPDX, 9 years ago
stig :

I can't see how you can possibly work around this - if it's not supported, it's not supported.

Yeah, that's what I thought. We wound up ditching the TOC links. Thanks :)

1800collect, 6 years ago

I found another search that showed Outlook 2007 was adding a <BASE href="file:///Users/Erin/Documents/Projects/newsletter.html"> for those who have to send an email by Send Page As. Here is the page that lead me to my conclusion: (In hopes Google will make it easier to find this solution but I can't post to that forum as the topic is too old)

You're coming up in a google search as well, I believe I found a solution for Outlook 2007 and anchor tags. Outlook does have the ability to do anchor tags if you do it in the actual program.For example if you put a header in Outlook and then add a hyperlink to some text somewhere else you can make an anchor to that header. So it is possible.

When you go to File > Send Page as Email in IE to send an email through Outlook someone else figured out it is adding the <base HREF="path-of-original-document">, which is breaking the anchor tags as it opens them to the original path of the document.

For companies where people need to send emails in this way, it makes anchor tags break as it opens them to the base of wherever the document was first created.

To override this there seems to be a simple hack I tried.

Add this into the header tag of the HTML.

<base href="">

Where href="" is nothing in the quotes.

This will override Outlook as you told it a base href. Because of this your anchor tags will now work as the base href is in the actual email and not some other source that Outlook put in by itself. So since you defined a base Outlook won't overwrite it.

You could add this in for good measure: <base target="_self" />

Tags to help others out: Outlook, Outlook 2007, anchor tags, anchor problems, anchor doesn't work. base href

This may work with companies that actually send out HTML emails on your behalf (like Campaign Monitor) if you put the base information in the header. Though it could get stripped. I haven't tried it out that way yet.

jerallyn jerallyn, 6 years ago

I've found that standard anchor tags do work in Outlook 2003 and 2007, 2007 just adds 100px above the <a name="story1"> location.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free