网页中的邮箱,mailto功能扩展

外贸建站
浏览次数 975

网页中要不要留下邮箱

要,但是不要怕垃圾邮件。有程序可以检测邮箱格式。比如以@为中心,前后都有空格就是一个邮箱了。这样子邮箱被他人抓取。很多网站上把@改为#,也是这个原因。

有想要不要加上mailto

既然已经加了邮箱,就是不怕垃圾邮件,(或者通过其他方式阻止垃圾邮件)那就更进一步,加上mailto

基本功能

唤起设备上的默认发件软件,比如foxmail或者outlook,以mailto后尖括号内的邮箱作为收件人,创建了一个写邮件动作。Open default mail program, create new message with the TO field already filled out.

<a href="mailto:someone@yoursite.com">Email Us</a>

增加一个标题

Open default mail program, create new message with the TO and SUBJECT field already filled out. Essentially we are adding the parameter subject to the href value.

Spaces in the subject will probably work OK, but to be super-extra sure, you can replace spaces with “%20”.

<a href="mailto:someone@yoursite.com?subject=Mail from Our Site">Email Us</a>

增加抄送和密送

Open default mail program, create new message with the TO, SUBJECT, CC, and BCC field already filled out. Essentially we are adding the parameters cc and bcc to the href value.

Also note that you add multiple values to CC and BCC by comma separating them.

<a href="mailto:someone@yoursite.com?cc=someoneelse@theirsite.com, another@thatsite.com, me@mysite.com&bcc=lastperson@theirsite.com&subject=Big%20News">Email Us</a>

增加邮件正文

Just add the body parameter into the ever-growing list of parameters we are using.

<a href="mailto:someone@yoursite.com?cc=someoneelse@theirsite.com, another@thatsite.com, me@mysite.com&bcc=lastperson@theirsite.com&subject=Big%20News&body=Body-goes-here">Email Us</a>
我们将在15分钟内联系你

免费提供行业网站方案以及海外推广计划