Monthly Archives: June 2011

It’s not a canned pre-cooked meat product

Spam

Spam, spam, spam, email and spam

Whenever you include an email address on a web page it may be vulnerable to spam attack.  This is because spammers use automated search programs (or spam spiders) to search for email addresses on the web to which they can then send their spam.

In CMS Made Simple, there’s a handy trick to encode an email address so that it displays and functions normally but cannot easily be found by an automated scanning system. This technique is sometimes referred to as ’email obfuscation.’

Instead of directly adding the email link in html as <a href=”mailto:me@example.com“>, you can use the Smarty {mailto} tag to encode the email address e.g.

  {mailto address="me@example.com" encode="javascript"}

The {mailto} tag will automatically encode the email address into Javascript, hex or other format, concealing it from spam harvesters. The above tag is encoded to:

<script>
    eval(unescape('%64%6f% ... snipped ...%61%3e%27%29%3b'))
</script>

The {mailto} tag supports parameters that allow you to specify the encoding method, text to display for the email link, email subject line, additional recipients and more. See more details on the Smarty {mailto} function at the Smarty website.