Html Mailto标签详细使用方法
Html中mailto标签是一个非常实用的贴近用户体验的标签,大多情况下人们都在这样使用
<a href="mailto:example@phplamp">example@phplamp</a>
这样,当我们点击了example@phplamp链接后浏览器会为我们自动选择本地的默认邮件软件,并将mailto标签后example@phplamp邮件地址放到邮件软件的发送地址中,少去了我们发送邮件时输入发送地址的烦扰,同时也可以避免输错邮件地址。
其实mailto标签有更实用的使用方法。比如:加入邮件默认标题,抄送地址,暗送(密件抄送)地址,邮件内容….
下面说一下详细的使用方法:
1. 为邮件加入默认标题
<a href="mailto:example@phplamp?subject=邮件的默认标题">example@phplamp</a>
2. 为邮件加入默认的抄送地址
<a href="mailto:example@phplamp?cc=example2@phplamp">example@phplamp</a>
3. 为邮件加入默认暗送(密件抄送)地址
<a href="mailto:example@phplamp?bcc=example2@phplamp">example@phplamp</a>href标签怎么用
4. 为邮件加入默认的内容
<a href="mailto:example@phplamp?body=欢迎您来到phplamp博客站-">example@phplamp</a>
5. 多个邮件地址
<a href="mailto:example@phplamp,example2@phplamp">example@phplamp</a>
6. 来个综合型的:加入默认抄送地址,标题,内容
<a href="mailto:example@phplamp?cc=example2@phplamp&subject=phplamp博客站&body=欢迎您来到phplamp博客站-">example@phplamp</a>
由上例可以看出,假如有多个默认值需要添加的话,与邮件地址相连接的字符为"?",默认值间相连接的符号为"&"。
原文地址:www.360doc/content/09/0805/14/16915_4684377.shtml

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。