使用mailto在网页中链接Email地址
<div>
<ul>
<li style=“list-style: square;”><a>标签中mailto的作用是可以链接Email地址,</li>
<li style=“list-style: square;”>mailto是网页设计制作中的一个非常实用的html标签,</li>
<li style=“list-style: square;”>许多拥有个人网页的朋友都喜欢在网站的醒目位置处写上自己的电子邮件地址,</li>
<li style=“list-style: square;”>这样网页浏览者一旦用鼠标单击一下由mailto组成的超级连接后,</li>
<li style=“list-style: square;”>就能自动打开当前计算机系统中默认的电子邮件客户端软件,例如OutLook Express以及Foxmail等。</li>
<li style=“list-style: square;”>但是由于各操作系统和邮件客户端对 mailto 事件连接的处理不一致,所以在实际应用的时候需要注意;</li>
</ul>
</div>
<div>
<h2><span style=“color: #00ccff;”><strong>基础语法</strong></span></h2>
<pre class=“line-numbers language-html”><code class=“language-html”><a href=mailto:imoshanghua1314@outlook.com>send</a> </code></pre>
</div>
<div>
<h2><span style=“color: #00ccff;”><strong>参数列表</strong></span></h2>
<div style=" width:100%; height:300px; margin:0 auto; border:1px solid #00ccff;">
<br />
<span style=“color:red;”><strong>mailto:</strong></span> 邮箱地址
<hr style=“color: #00ccff;” />
<span style=“color:red;”><strong>to:</strong></span> 收信人(多个之间用;分割)
<hr style=“color: #00ccff;” />
<span style=“color:red;”><strong>suject:</strong></span> 主题
<hr style=“color: #00ccff;” />
<span style=“color:red;”><strong>cc:</strong></span> 抄送
<hr style=“color: #00ccff;” />
<span style=“color:red;”><strong>bcc:</strong></span> 暗抄送
<hr style=“color: #00ccff;” />
<span style=“color:red;”><strong>body:</strong></span> 内容(部分邮件客户端支持html格式语句)
</div>
<span style=“color:red;”><strong>注意:如果mailto后面同时有多个参数的话,第一个参数必须以“?”开头,后面的参数每一个都以“&”分隔。</strong></span>
</div>
<div>
<h2><span style=“color: #00ccff;”><strong>实例</strong></span></h2>
下面是一个完整的实例:
<pre class=“line-numbers language-html”><code class=“language-html”><a href="mailto:imoshanghua1314@outlook.com?cc=imoshanghua1314@outlook.com&bcc=imoshanghua1314@outlook.com&subject=主题&body=this is body">send</a> </code></pre>
<br />
在浏览器中显示的结果:
<a href="mailto:imoshanghua1314@outlook.com?cc=imoshanghua1314@outlook.com&bcc=imoshanghua1314@outlook.com&subject=主题&body=this is body">send</a>
<br />
点击链接会打开电子邮件应用,并自动填写收件人等设置好的信息,如下图:
<img src=“http://moshanghua.oss-cn-shanghai.aliyuncs.com/images/msh_mailto.png"alt="mailto”>
</div>
