简体   繁体   English

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

[英]adding text automatically to an email loaded in mailto: link

I currently have a mailto: link on my website so the user can email myself, however what I am trying to work out is how I can add compulsory text to the email they send me. 我目前在我的网站上有一个mailto:链接,以便用户可以给自己发送电子邮件,但是我要设法解决的是如何在他们发送给我的电子邮件中添加强制性文本。 To clarify I want a sentence to load inside the email when they click the mailto: link. 为了澄清,我希望当他们单击mailto:链接时在电子邮件中加载一个句子。

Thanks 谢谢

the html code for the mailto: link is below mailto:链接的html代码在下面

<div align="center"><a href="mailto:interns@cambridgedesign.company"><img src="mailimage.png" width="75" height="75"/></a></div>
<a href="mailto:someone@example.com?subject=This%20is%20the%20subject&cc=someone_else@example.com&body=This%20is%20the%20body">Send email</a>

As you can see in addition to the To address, we can easily specify: 如您所见,除了“收件人”地址外,我们还可以轻松指定:

  1. The Subject 主题
  2. The Body 身体
  3. CC Address 抄送地址

The latest RFC for the same can be found here: http://tools.ietf.org/html/rfc6068 . 可以在这里找到相同的最新RFC: http : //tools.ietf.org/html/rfc6068 The Wikipedia article for mailto is also detailed. 有关mailtoWikipedia文章也有详细介绍。

Make sure you URL encode any text you add to the body and subject. 确保对您添加到正文和主题的所有文本进行URL编码。

An online text to URL encoder can be found here. 可以在此处找到在线文本到URL编码器

<div align="center"><a href="mailto:interns@cambridgedesign.company?body=yourtext"><img src="mailimage.png" width="75" height="75"/></a></div>

Added body parameter to the href. 将身体参数添加到href中。 ?body=yourtext

Add Body parameter to your mailto url: 将Body参数添加到您的mailto网址:

<div align="center"><a href="mailto:interns@cambridgedesign.company?subject=Your_Subject&body=Your_Body_Text"><img src="mailimage.png" width="75" height="75"/></a></div>

This Tool is useful for making Email Link: http://angrytools.com/email/ 该工具对于建立电子邮件链接非常有用: http : //angrytools.com/email/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM