Yes, look all tips and tricks with mailto: http://www.angelfire.com/dc/html-webmaster/mailto.htm
(是的,请使用mailto查看所有提示和技巧: http : //www.angelfire.com/dc/html-webmaster/mailto.htm)
mailto subject example:
(mailto主题示例:)
mailto with content:
(mailto内容:)
<a href="mailto:[email protected]?subject=look at this website&body=Hi,I found this website and thought you might like it http://www.geocities.com/wowhtml/">tell a friend</a>
As alluded to in the comments, both subject
and body
must be escaped properly.
(正如评论中提到的那样, subject
和body
必须适当地转义。)
Use encodeURIComponent(subject)
on each, rather than hand-coding for specific cases. (在每种情况下都使用encodeURIComponent(subject)
,而不是对特定情况进行手工编码。)
As Hoody mentioned in the comments, you can add line breaks by adding the following encoded sequence in the string:
(如Hoody在评论中所述,您可以通过在字符串中添加以下编码序列来添加换行符:)
%0D%0A // one line break
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…