Get Smarty



Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty



{mailto}可以自动创建一个mailto:链接,而且可以选择编码方式。 对邮件编码可以使邮件地址更难以被网络爬虫抓取。



参数名称 类型 必选参数 默认值 说明
address string Yes n/a 电邮地址
text string No n/a 显示的文字,默认是电邮地址
encode string No none 如何编码电邮。可以是none, hex, javascript 或者 javascript_charcode.
cc string No n/a 抄送的电邮地址,用逗号隔开。
bcc string No n/a 暗送的地址,用逗号隔开。
subject string No n/a 邮件标题
newsgroups string No n/a 发送到的新闻组地址,用逗号隔开。
followupto string No n/a 回执地址,用逗号隔开。
extra string No n/a 任何附加的链接信息,如样式表等

Example 8.20. {mailto}例子和其输出的结果

{mailto address=""}
<a href="" ></a>

{mailto address="" text="send me some mail"}
<a href="" >send me some mail</a>

{mailto address="" encode="javascript"}
<script type="text/javascript" language="javascript">
   eval(unescape('%64%6f% ... snipped ...%61%3e%27%29%3b'))

{mailto address="" encode="hex"}
<a href="mailto:%6d%65.. snipped..3%6f%6d">&#x6d;&..snipped...#x6f;&#x6d;</a>

{mailto address="" subject="Hello to you!"}
<a href="" ></a>

{mailto address="" cc=","}
<a href="," ></a>

{mailto address="" extra='class="email"'}
<a href="" class="email"></a>

{mailto address="" encode="javascript_charcode"}
<script type="text/javascript" language="javascript">
    {document.write(String.fromCharCode(60,97, ... snipped ....60,47,97,62))}

参见 转码, {textformat}混淆邮件地址.

No comments for this page.