Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 2.97 KB

language-function-mailto.md

File metadata and controls

61 lines (46 loc) · 2.97 KB

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

Attributes

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

Note

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

Examples

{mailto address="[email protected]"}
<a href="mailto:[email protected]" >[email protected]</a>

{mailto address="[email protected]" text="send me some mail"}
<a href="mailto:[email protected]" >send me some mail</a>

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

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

{mailto address="[email protected]" subject="Hello to you!"}
<a href="mailto:[email protected]?subject=Hello%20to%20you%21" >[email protected]</a>

{mailto address="[email protected]" cc="[email protected],[email protected]"}
<a href="mailto:[email protected][email protected],[email protected]" >[email protected]</a>

{mailto address="[email protected]" extra='class="email"'}
<a href="mailto:[email protected]" class="email">[email protected]</a>

{mailto address="[email protected]" encode="javascript_charcode"}
    <script>
    {document.write(String.fromCharCode(60,97, ... snipped ....60,47,97,62))}
</script>

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