Files
smarty/docs/en/designers/language-custom-functions/language-function-mailto.xml

163 lines
5.2 KiB
XML
Raw Normal View History

2004-04-13 08:46:28 +00:00
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.mailto">
<title>mailto</title>
<informaltable frame="all">
<tgroup cols="5">
<colspec colname="param" align="center" />
<colspec colname="type" align="center" />
<colspec colname="required" align="center" />
<colspec colname="default" align="center" />
<colspec colname="desc" />
<thead>
<row>
<entry>Attribute Name</entry>
<entry>Type</entry>
<entry>Required</entry>
<entry>Default</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>address</entry>
<entry>string</entry>
<entry>Yes</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>the e-mail address</entry>
</row>
<row>
<entry>text</entry>
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>the text to display, default is the e-mail address</entry>
</row>
<row>
<entry>encode</entry>
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>none</emphasis></entry>
<entry>How to encode the e-mail. Can be one of <literal>none</literal>,
2005-05-10 11:42:40 +00:00
<literal>hex</literal>, <literal>javascript</literal>
or <literal>javascript_charcode</literal>.</entry>
</row>
<row>
<entry>cc</entry>
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>e-mail addresses to carbon copy. Separate entries by a comma.
</entry>
</row>
<row>
<entry>bcc</entry>
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>e-mail addresses to blind carbon copy.
2005-05-10 11:42:40 +00:00
Separate entries by a comma.</entry>
</row>
<row>
<entry>subject</entry>
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>e-mail subject.</entry>
</row>
<row>
<entry>newsgroups</entry>
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>newsgroups to post to. Separate entries by a comma.</entry>
</row>
<row>
<entry>followupto</entry>
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>addresses to follow up to. Separate entries by a comma.</entry>
</row>
<row>
<entry>extra</entry>
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>any extra information you want passed to the link, such
2005-05-10 11:42:40 +00:00
as style sheet classes</entry>
</row>
</tbody>
</tgroup>
</informaltable>
2005-05-10 11:42:40 +00:00
<para>
mailto automates the creation of mailto links and optionally
encodes them. Encoding e-mails makes it more difficult for
web spiders to pick up e-mail addresses off of your site.
</para>
<note>
<title>Technical Note</title>
<para>
javascript is probably the most thorough form of
encoding, although you can use hex encoding too.
</para>
2005-05-10 11:42:40 +00:00
</note>
<example>
<title>mailto</title>
<programlisting>
2005-05-10 11:42:40 +00:00
<![CDATA[
{mailto address="me@example.com"}
{mailto address="me@example.com" text="send me some mail"}
{mailto address="me@example.com" encode="javascript"}
{mailto address="me@example.com" encode="hex"}
{mailto address="me@example.com" subject="Hello to you!"}
{mailto address="me@example.com" cc="you@example.com,they@example.com"}
{mailto address="me@example.com" extra='class="email"'}
{mailto address="me@example.com" encode="javascript_charcode"}
]]>
</programlisting>
<para>
The above example will output:
</para>
<screen>
<![CDATA[
<a href="mailto:me@example.com" >me@example.com</a>
<a href="mailto:me@example.com" >send me some mail</a>
<script type="text/javascript" language="javascript">eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%6
9%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%
61%69%6e%2e%63%6f%6d%22%20%3e%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%3c%2f%61%3e
%27%29%3b'))</script>
<a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" >&#x6d;&#x65;&#x40;&#x64;&#x6f;&#x6d;&#x61;&#x69;&#x6e;&#x2e;&#x63;&#x6f;&#x6d;</a>
<a href="mailto:me@example.com?subject=Hello%20to%20you%21" >me@example.com</a>
<a href="mailto:me@example.com?cc=you@example.com%2Cthey@example.com" >me@example.com</a>
<a href="mailto:me@example.com" class="email">me@example.com</a>
<script type="text/javascript" language="javascript">
<!--
{document.write(String.fromCharCode(60,97,32,104,114,101,102,61,34,109,97,105,108,116,111,58,109,101,64,101,120,97,109,112,108,101,46,99,111,109,34,32,62,109,101,64,101,120,97,109,112,108,101,46,99,111,109,60,47,97,62))}
//-->
</script>
]]>
</screen>
</example>
2004-04-13 08:46:28 +00:00
</sect1>
<!-- Keep this comment at the end of the file
2005-05-10 11:42:40 +00:00
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->