2011-06-29 89 views
2

in my code I generate a body of a html email message. Part of it is following:链接无法在<a href> tag when content has .com inside

<a href="mylink.pl">SomeName.com</a> 

When I receive this email in my Mail client or in Gmail and when I click the link I'm directed to the SomeName.com and not to the mylink.pl which is in the href part of the <a> tag. And it looks that this situation occurs only for the .com domains.

Any ideas how I could deal with this?

+1

Try using absolute urls as Quentin mentioned. Tongue in cheek, that code snippet seems to be for phishing :-) – Satish

+0

No it's not fishing, we just want to count how many times our users go to different sited from our links, so the link leads to our service, but the user is automatically redirected to the service SomeName.com – Jakub

+0

So what you really want is: 'SomeName.com'正确? –

回答

9

Use absolute URIs in emails. They start with (usually) http://

What you have is a relative URI, which doesn't make much sense in an email. You are probably just hitting your browser's search function when you try to visit it.

+0

有http://,所以基本上代码如下: SomeName.com Jakub

+2

@Jakub:看看昆汀的答案,然后看看你的链接。现在回头看看答案。可悲的是,您的链接链接不包含“http://”。尝试类似'YourDomain.com' –

+0

对不起,我忘了将格式设置放入最后一条评论。我使用的链接如下:' Jakub

相关问题