Protecting your email address. [ Technical ]

Spam. We all get it, we all hate it. The rise in volume is unabated and will threaten email as a useful tool if allowed to continue at its present rate. One of the most common ways for your email to make its way into the hands of spammers is by publishing it somewhere on the internet - a discussionboard, newsgroups, email lists and even your company website.

A simple yet effective solution is to obscure or mask your email from harvesting.The code snippet below provides a simple javascript mask, its output is exactly the same as a normal email link.

Instructions :

1 Edit the two variables name & domain to your name and domain.
2 Insert it where ever you would like your email address to appear on your webpage.


<script language="JavaScript">
<!--
var name = "john";
var domain = "doe.com";

document.write('<a href="mailto:' + name + '@' + domain + '">');
document.write(name + '@' + domain + '</a>');
// -->

</script>
05 Dec 2003


This article is intended to provide general guidance and does not constitute professional advice relating to specific instances. Should you wish to place any reliance on the information presented in this article we strongly advise that you consult your legal advisor or the Electronic Law Consultancy - info@e-lawconsultancy.co.za