当我使用mailto:时,是否可以设置电子邮件的主题/内容?
是的,请看所有的技巧和窍门与mailto: http://www.angelfire.com/dc/html-webmaster/mailto.htm
mailto主题的例子。
<a href="mailto:[email protected]?subject=free chocolate">example</a>
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>
正如评论中所提到的,subject'和
body'都必须被正确转义。对每一个都使用`encodeURIComponent(subject)',而不是在特定情况下手工编码。
正如Hoody在评论中提到的,你可以通过在字符串中加入以下编码序列来添加换行符。
%0D%0A // one line break