3

我需要在我的网站上添加一个“发送给朋友”链接。

当用户点击它时,他们的电子邮件软件应该会打开并且电子邮件应该已经填满。

主题:网站名称正文:网站链接,简短说明

那可能吗 ?谢谢

4

6 回答 6

8
<a href="mailto:enteryour@addresshere.com?subject=Website Name&body=Link to website, short description">Send me an email</a>

是一种方式。

于 2010-07-24T19:11:01.977 回答
2

使用协议 mailto 和 GET 参数是正确的,但您还必须对字符串使用 urlencoded 版本:

<a href="mailto:enteryour@addresshere.com?subject=Website+Name&body=Link+to+website%2C+short+description">Send me an email</a>

空格变为“+”或“%20”。PHP为此提供函数urlencode(),python 2.x urllib模块的urllib.urlencode(),Perl有URI::Escape包的uri_escape ...等等。

于 2010-07-24T21:58:44.643 回答
1

<a href="mailto:myfriend@gmail.com?subject=Patrick's Website at patrickrules.com&body=<a href="http://www.patrickrules.com&quot; title="Link to Patrick's Official Website">It's Patrick's Official Website!</a>">Send to a friend

于 2010-07-24T19:46:27.913 回答
0
<a href="mailto:s123@example.com?subject=Feedback for 
webdevelopersnotes.com&body=Link to website, short description">Send to a friend</a>
于 2010-07-24T19:11:31.863 回答
0

使用<a href="mailto:..." />.

参考

于 2010-07-24T19:12:29.100 回答
0

我认为您将需要一个简单的表格来允许人们在那里输入朋友的电子邮件地址。也许是 php 邮件(以防万一人们没有电子邮件程序)。

于 2010-07-24T21:19:02.853 回答