Get Smarty

Donate

Donate Bitcoin Bitcoin
Paypal

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

Largest classified with thousands of ads at Shoppok

Buy cheap eyeglasses from Cheapglasses123.com and save up to 80%.

Buy prescription glasses from www.australiaglasses.com and save.

Cheap Glasses Now On Sale at GlassesPeople.com. Starts At $7.95.

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Find Wedding Dresses Online at Canada from Ca-dresses.com

Find your local domestic cleaner

Brautkleider auf Topwedding.de

Find free files to download on allwhatyouwant.net

Looking For Affordable Wedding Dresses 2015 at Best Prices On TDBridal.com

Shop high quality cheap prom dresses on Dresswe.co.uk

Advertisement

{mailto}

{mailto} automates the creation of a mailto: anchor links and optionally encodes them. Encoding emails makes it more difficult for web spiders to lift email addresses off of a site.

Technical Note

Javascript is probably the most thorough form of encoding, although you can use hex encoding too.

Attribute Name Type Required Default Description
address string Yes n/a The e-mail address
text string No n/a The text to display, default is the e-mail address
encode string No none How to encode the e-mail. Can be one of none, hex, javascript or javascript_charcode.
cc string No n/a Email addresses to carbon copy, separate entries by a comma.
bcc string No n/a Email addresses to blind carbon copy, separate entries by a comma
subject string No n/a Email subject
newsgroups string No n/a Newsgroups to post to, separate entries by a comma.
followupto string No n/a Addresses to follow up to, separate entries by a comma.
extra string No n/a Any extra information you want passed to the link, such as style sheet classes

Example 8.23. {mailto} example lines followed by the result


{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>


See also escape, {textformat} and obfuscating email addresses.

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 6 plus 8? (Are you human?)

Advertisement

Sponsors [info]

UK Web Hosting @webhost.uk.net
Best Web Hosting @rshosting.com
Web Hosting UK @webhostinguk.com
Unlimited Web Hosting @infrenion.com
App Entwicklung @morphodo.com
First Click Internet Marketing @fcinternetmarketing.com
Credit Card Processing Company