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:

Check reviews of PHP Web Hosting, compatible with Smarty Templates

{mailto}

{mailto} は、mailto: リンクの作成とメールアドレスのエンコードを自動的に行います。 メールアドレスをエンコードすることで、 アドレス収集ソフトがあなたのサイトからメールアドレスを取得することを困難にします。

テクニカルノート

Javascript がおそらく一番徹底したエンコードを行いますが、 hexエンコードも使用する事が出来ます。

属性名 必須 デフォルト 概要
address string Yes n/a メールアドレス
text string No n/a 表示するテキスト。デフォルトではメールアドレス。
encode string No none メールアドレスのエンコード方法。 nonehexjavascript あるいは 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.23. {mailto} のサンプルと、その結果


{mailto address="me@example.com"}
<a href="mailto:me@example.com" >me@example.com</a>

{mailto address="me@example.com" text="send me some mail"}
<a href="mailto:me@example.com" >send me some mail</a>

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

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

{mailto address="me@example.com" subject="Hello to you!"}
<a href="mailto:me@example.com?subject=Hello%20to%20you%21" >me@example.com</a>

{mailto address="me@example.com" cc="you@example.com,they@example.com"}
<a href="mailto:me@example.com?cc=you@example.com%2Cthey@example.com" >me@example.com</a>

{mailto address="me@example.com" extra='class="email"'}
<a href="mailto:me@example.com" class="email">me@example.com</a>

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


escape{textformat} および E-mail アドレスを混乱させる も参照してください。

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 11 plus 5? (Are you human?)

Sponsors [info]

Cheap Website Hosting @hostdone.com
email marketing @ActiveCampaign
broadband deals @BroadbandGenie
Best UK Web Hosting @webhost.uk.net
Reliable UK and US Web Hosting @rshosting.com
Cheap US and UK Web Hosting @infrenion.com
I.T Certification Exams @pass-guaranteed.com
Certification Practice Tests @firsttrycertify.com
Certification Practice Exam Questions @ace-it-certifications.com
Broadband Speed Test @broadbandspeed.co.uk
bulk email software @americaint.com
ASP.NET hosting @aspnethosting.co.uk