email encoder

Sick of spam? Prevention is better than cure

If you have you email posted somewhere on the web, you may have noticed an increase in spam to that address. This is because spammers use web-crawlers (programs that scan the web) to retrieve email addresses for their mailing lists. THese programs look for code formatted as an email address (eg. me@somedomain.com  which is encoded as a HTML link with the HREF property set to mailto:me@somedomain.com

The only way to prevent this is to hide the email from the crawlers in some way. One way to do this is to use Javascript to decode your email address from a previously encoded version which is stored on the page. THis is a script that does just that. It just requires a basic knowledge of HTML and javascript.

instructions
  • download decodeEmail.zip and extract the files, "encode.html", "decodeEmail.html", "decodeEmail.js"
  • open encode.html in a browser
  • enter the domain name (eg. 'mydomain.org') into the encoder and encode it
  • copy the series of numbers which is the encoded version of the domain name
  • open decodeEmail.html in a text-editor and find the line (in the javascript block in the HEAD):

addressList[0] = new Array("dave",106,117,106,117,119,101,98,100,101,115,105,103,110,46,99,111,109);

  • paste your numbers over the numbers in the array.

  • also change 'dave' to to the name used in the email address you want to encode

  • further down on the page you will see the javascript commmand

writeEmail('dave');  

  • change the name here to the one you used above
  • open decodeEmail.html in a browser: you should see your email address encoded

For convenience, I have also included an external javascript with the decoder script so that you can simply include it on your page. Then you can encode as many emails as you like and simply insert them onto pages with the javascript code "writeEmail('username');" where 'username' corresponds to an email you have encoded and inserted into decodeEmail.js.