当我使用mailto:时,是否可以设置电子邮件的主题/内容?


当前回答

是的,你可以这样做:

mailto: email@host.com?subject=something

其他回答

我把它分成几行,让它更容易读。

<a href="

    mailto:johndoe@gmail.com

    ?subject=My+great+email+to+you

    &body=This+is+an+awesome+email

    &cc=janedoe@gmail.com

    &bcc=billybob@yahoo.com

">Click here to send email!</a>

注意,根据RFC 2368,不能在消息体中使用HTML:

特殊名称“body”表示关联的hvalue是消息体。“body”名称应该包含消息的第一个文本/纯正文部分的内容。mailto URL主要用于生成短文本消息,这些消息实际上是自动处理的内容(例如邮件列表的“订阅”消息),而不是一般的MIME体。

来源:https://stackoverflow.com/a/13415988/1835519

您可以使用以下任何一种方式向mailto命令添加已添加的主题。 将?subject outmailto添加到mailto标签。

<a href="mailto:test@example.com?subject=testing out mailto">First Example</a>

我们还可以将文本添加到消息体中,方法是在标记的末尾添加&body,如下面的示例所示。

 <a href="mailto:test@example.com?subject=testing out mailto&body=Just testing">Second Example</a>

除正文外,用户还可以输入&抄送或&密件抄送来填写抄送和密件抄送字段。

<a href="mailto:test@example.com?subject=testing out mailto&body=Just testing&cc=test1@example.com&bcc=test1@example.com">Third
    Example</a>

如何添加主题到邮件标签

<a href="mailto:manish@simplygraphix.com?subject=Feedback for 
webdevelopersnotes.com&body=The Tips and Tricks section is great
&cc=anotheremailaddress@anotherdomain.com
&bcc=onemore@anotherdomain.com">Send me an email</a>

您可以使用此代码设置主题,正文,抄送,密件

是的:

使用它来试验mailto表单元素和链接编码。

你可以输入主题,主体(即内容)等到表单,点击按钮,看到mailto html链接,你可以粘贴到你的页面。

你甚至可以指定很少被知道和使用的元素:抄送,密件抄送,从电子邮件。