want to insert <a> link to home page of my site in the body part of mailto tag [duplicate]

随声附和 提交于 2021-01-29 11:05:13

问题


Possible Duplicate:
Is it possible to add an HTML link in the body of a MAILTO link

I need to insert the below text in the body part of mailto tag.

There is no problem in first line. But second line is link back to my site homepage.

"Inspiration from Author Name: Post title... (include the 3 dots at end of title) View in full at here! [this line is a link back to actual post URL]"

Please help me on this.


回答1:


Adding HTML in an email is considered bad practice, you should just put a URL in the body text and let the Email client automatically convert it to a clickable link.

<a href="mailto:emailgoeshere?subject=SUBJECT&body=Check out this URL: http://www.example.com/">some text</a>

You could also try the following (by using HTML-escape codes) to try to force a link with some regular text:

<a href="mailto:emailgoeshere?subject=SUBJECT&body=Check out this URL: &lt;a href='http://www.example.com/'&gt;SOME LINK&lt;/a&gt;">some text</a>

However here's my major disclaimer that this will probably end up looking like crap on most email clients (unless the default/preferred mail format is already set to HTML by the user).




回答2:


Just use this:

<a href="mailto:emailgoeshere">some text</a>

Using this method will produce a link that creates an email.

Hope this helps you.



来源:https://stackoverflow.com/questions/9059427/want-to-insert-a-link-to-home-page-of-my-site-in-the-body-part-of-mailto-tag

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!