如何使用Mailto URL与主题发送邮件?

23 html mailto uri

我需要在Mailto link我的网站上创建一个包含产品名称或产品页面网址的网站subject section.我该怎么做?
Exp:当您收到eBay有关您正在销售或购买的产品的电子邮件时,您会通过查看主题部分中的产品名称自动了解该电子邮件的产品.
我怎样才能做到这一点?

小智 10

在我没有url编码值之前我遇到了这个问题,所以我建议(使用lc的例子):

<a href="mailto:foo@bar.com?subject=This+Is+My+Product">
Run Code Online (Sandbox Code Playgroud)

要么

<a href="mailto:foo@bar.com?subject=This%20Is%20My%20Product">
Run Code Online (Sandbox Code Playgroud)


lc.*_*lc. 5

此页 [Link Dead]概述了 mailto URI 的语法:

您正在寻找的是:

<a href="mailto:foo@bar.com?subject=This Is My Product">
Run Code Online (Sandbox Code Playgroud)

+请注意,使用 a或 a对空格进行 URL 编码可能是个好主意%20

<a href="mailto:foo@bar.com?subject=This+Is+My+Product">
Run Code Online (Sandbox Code Playgroud)