2011-06-29 91 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

相關問題