Anti-Spam: Email Address Protection

Anti-Spam: Email Address Protection

Protect your Email Address

Because of the huge problem of spammers today, people are almost afraid to put their email address on their web site for fear that the spam robots will come along and collect the address.

There are a few ways to protect your email address and still give people a chance to email you. One way is to use a server side script to send an email and the other way is to encode your address on the web page itself. I present two ways to do it.

1. The simple way to protect your email address:

<a href="mailto:yourName&#64;">Email me</a>

The text '&#64;' effectively replaces the '@' symbol. But when a user clicks on the link it will work well.

2. JavaScript

This option is more complicated but still easy to use. Here we are using a Javascript to encode the whole email address. Once encoded you can just paste the encoded text into your page and once again it will work fine.

  (ex: mailto:
Email address:


Type in your email address, click the 'Obfuscate Email' button, copy and paste the obfuscated email address into your web page.

Example result:


In your browser, the link will look as is usually does: email me!

> Check out the source code to see what it looks like.

Please note! This is not 100% foolproof!

Special thanks to Matti Tukiainen for coming up with the original idea of using Javascript to do this.

© 1996 - – All rights reserved