自动将文本添加到 mailto: 链接中加载的电子邮件中

问题描述 投票:0回答:4

我目前在我的网站上有一个 mailto: 链接,以便用户可以给自己发送电子邮件,但是我正在尝试解决的是如何在他们发送给我的电子邮件中添加强制文本。为了澄清,我希望当他们单击 mailto: 链接时在电子邮件中加载一个句子。

谢谢

mailto: 链接的 html 代码如下

<div align="center"><a href="mailto:[email protected]"><img src="mailimage.png" width="75" height="75"/></a></div>
javascript html css email mailto
4个回答
3
投票
<a href="mailto:[email protected]?subject=This%20is%20the%20subject&[email protected]&body=This%20is%20the%20body">Send email</a>

正如您所看到的,除了“收件人”地址之外,我们还可以轻松指定:

  1. 主题
  2. 身体
  3. 抄送地址

可以在这里找到相同的最新 RFC:https://www.rfc-editor.org/rfc/rfc6068mailto

维基百科文章也很详细。

确保对添加到正文和主题的任何文本进行 URL 编码。

可以在此处找到 在线文本到 URL 编码器。


1
投票

将 Body 参数添加到您的 mailto url 中:

<div align="center"><a href="mailto:[email protected]?subject=Your_Subject&body=Your_Body_Text"><img src="mailimage.png" width="75" height="75"/></a></div>

此工具对于制作电子邮件链接非常有用:http://angrytools.com/email/


0
投票
<div align="center"><a href="mailto:[email protected]?body=yourtext"><img src="mailimage.png" width="75" height="75"/></a></div>

在 href 中添加了 body 参数。

?body=yourtext


0
投票

如何才能包含附件?

© www.soinside.com 2019 - 2024. All rights reserved.