Slightly OT: Coding an HTML email, Gmail automatically converts links?

Hi all,

I am coding an HTML email, and testing it in email clients. All are fine, apart from Gmail. If I have this code:

<a href="[example-tracking-code]"><font style="color: #ff0000; font-size: 12pt;">MyDomain.com</font></a>

or even:

<a href="[example-tracking-code]" style="color: #ff0000; font-size: 12pt;">MyDomain.com</a>

Gmail sees that MyDomain.com is the anchor and automatically strips the tracking code out and puts the link as blue (the browser default?). Other email clients are fine.

Any advice on this guys?

Thanks all

I don’t see it. I just sent my gmail address an HTML mail, from a non-gmail address, using the exact HTML you used but a real URL with query string. The URL was not modified by gmail at all.

Maybe it’s doing it because it can’t decipher a URL from the href attribute? If there’s a proper URL, it won’t automatically link the text?

Apologies, I should have added that the URL does get modified (I will post the exact code) but just as importantly Gmail strips the style and the colours, leaving it blue. This is a pain due to the design of of the email…

Attached is an emample of what is happening in Gmail.

<div style="margin-top: 8px; margin-bottom: 5px"><a href="[EMV LINK]56[EMV /LINK]"><font style="font-family: sans-serif; color: rgb(255, 255, 255); font-size: 9pt; text-decoration: underline" color="#ffffff">[EMV FIELD]EMVADMIN2[EMV /FIELD]</font></a><br></div>

Below is the same code for a different link, which works no problem:

<div style="margin-top: 8px; margin-bottom: 5px"><a href="[EMV LINK]62[EMV /LINK]" style="margin-bottom: 3px"><font style="font-family: sans-serif; color: rgb(255, 255, 255); font-size: 9pt; text-decoration: underline" color="#ffffff">Job Search</font></a><br></div>

[EMV FIELD]EMVADMIN2[EMV /FIELD] is a piece of code from our email software the puts in the domain of our site. It seems as soon as Gmail see’s the domain as the anchor, it strips the main link.

Attached is another example of whats happening. The code is below.

<a href="[EMV LINK]42[EMV /LINK]"><font style="font-family: sans-serif; color: rgb(255, 255, 255); font-size: 16pt; text-decoration: underline" color="#ffffff">[EMV FIELD]EMVADMIN2[EMV /FIELD]</font>

I believe that even if you use;


<a href="http://www.mydomain.com/"><font style="font-family: sans-serif; color: rgb(255, 255, 255); font-size: 12pt; text-decoration: underline" color="#ffffff">MyDomain.com</font>

Gmail will strip the styles and will link direct to “http://mydomain.com”. Obviously using styles in an HTML email is a bit shady due to the clients compatibility, but with other links Gmail works fine and other clients are also fine.

After viewing the source in Gmail, it seems that when Gmail see’s a domain, it automatically links it. Below is the source;

<a href="[our-tracking-code]" bgcolor="#ffffff" target="_blank"><font style="font-family: sans-serif; color: rgb(255, 255, 255); font-size: 16pt; text-decoration: underline;" color="#ffffff"></font></a><font style="font-family: sans-serif; color: rgb(255, 255, 255); font-size: 16pt; text-decoration: underline;" color="#ffffff">[B]<a href="http://MySheffieldJobs.co.uk" target="_blank">[/B]MySheffieldJobs.co.uk</a></font>

As you can see, it is linking the domain exactly as it see’s it, adding http:// before it. I’m confused in what to try next! I could change the default color of standard links, but I’m 100% that will make matters worse for other email clients.

Any ideas guys?

Cheers

Put the style on the link itself, not on a font tag inside the link.

I’ve also tried that to no avail.

Then you’ve got something in your code that your examples aren’t showing us, because Gmail doesn’t do that.

I can send you my code if you’d like to see it :slight_smile:

Ok this is driving me nuts.

This is my code (its for the header of the email)

<center>
<table width="648" style="background-color: rgb(19, 52, 103);" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="20">
<img src="http://webe.emv3.com/myjobgroup/registered-topleft.png" width="20" height="74" border="0" style="display:block;"></a></td>
<td width="419" align="left" valign="middle">
[COLOR="Red"]<a href="http://www.mybristoljobs.co.uk/Jobsite/Index.php"><span style="font-family:verdana;font-size:17px;color:#ffffff;">MyBristolJobs.co.uk</span></a>[/COLOR]</td>
<td width="189" align="right" valign="middle" style="font-family: sans-serif; font-size: 14pt; font-weight: bold; color: #bed9ed;">
May 2009</td>
<td width="20">
<img src="http://webe.emv3.com/myjobgroup/registered-topright.png" width="20" height="74" border="0" style="display:block;"></a></td>
</tr>
</table>
</center>

I send it to my Gmail using our email marketing software. The link is ignored altogether. I click to forward the email. I highlight the header, right click and ‘View selection source’ and the code is being altered below.

<center>
<table style="background-color: rgb(19, 52, 103);" width="648" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td width="20">
<img src="http://webe.emv3.com/myjobgroup/registered-topleft.png" style="display: block;" width="20" border="0" height="74"></td>
<td valign="middle" width="419" align="left">
[COLOR="Red"]<a href="http://www.mybristoljobs.co.uk/Jobsite/Index.php" target="_blank"><span style="font-family: verdana; font-size: 17px; color: rgb(255, 255, 255);"></span></a>[COLOR="DarkRed"][B]<a href="http://MyBristolJobs.co.uk" target="_blank">[/B][/COLOR]MyBristolJobs.co.uk</a>[/COLOR]</td>
<td style="font-family: sans-serif; font-size: 14pt; font-weight: bold; color: rgb(190, 217, 237);" valign="middle" width="189" align="right">
May 2009</td>
<td width="20">
<img src="http://webe.emv3.com/myjobgroup/registered-topright.png" style="display: block;" width="20" border="0" height="74"></td>
</tr>

</tbody></table>
</center>

Google see’s the domain and automatically places a link around it. Why? :sick:

After looking at other companies marketing emails, I tried the following code which works but only with a .com extension. I add .co.uk, Gmail again ignores my link and adds its own, which ignores the styling.

<a href="http://www.mybristoljobs.co.uk/Jobsite/Index.php" target="_blank"><span style="font-size: 14pt; color: windowtext;"><font color="#ffffff">MyBristolJobs.co.uk</font></span></a>

Has anyone had similar issues?!