Smarty Manual
Prev | Chapter 17. Tips & Tricks | Next

# Obfuscating E-mail Addresses

Do you ever wonder how your E-mail address gets on so many spam mailing lists? One way spammers collect E-mail addresses is from web pages. To help combat this problem, you can make your E-mail address show up in scrambled javascript in the HTML source, yet it it will look and work correctly in the browser. This is done with the mailto plugin.

Example 17-8. Example of Obfuscating an E-mail Address
    index.tpl
    ---------

    Send inquiries to
    {mailto address=$EmailAddress encode="javascript" subject="Hello"}

> Technical Note: This method isn't 100% foolproof. A spammer could conceivably program his e-mail collector to decode these values, but not likely.

Prev | Home | Next
Componentized Templates | Up | Resources