Safe Browsing Part 2, Protecting Your Email

 
Published on 2001-08-08 by John Collins.

Spider Bots

If you have a web site then you most likely have an e-mail address on your site. Your aim with providing an e-mail address to your site visitors is simple: to allow them to communicate with you on genuine matters. You do not want to have your address abused by spam, placed on a mailing list without your consent and continually bombarded with information you do not need (or want) to know. I have had such an experience with an old e-mail account I included on a site a number of years ago, which I was forced to stop using due to excessive spamming. To this day this account continues to receive about 50 junk mails a day!

"Spider Bot" is a term applied to programs designed to follow links through the Net and catalogue web sites, most commonly for search engines. While search engine Bots are to be encouraged, some people have modified this technology to harvest e-mail addresses from web sites and include them in their mailing lists. If you have an online e-mail address and begin to receive unsolicited junk mail, it is possible that you have fallen victim to such a nuisance.

The Solution

Traditional mailto links are set up in the following way:

<a href="mailto:your@address.com"></a>

When the user clicks on the link their default e-mail tool is opened and "your@address.com" is entered into the send-to field. It is this format that the Spider Bot is programmed to recognize and collect. Using JavaScript you can achieve the same on-screen result in a manner designed to confuse the Bot, therefore protecting your online privacy:

<SCRIPT LANGUAGE="JavaScript">
// protects e-mail from bots
user = 'your';
site = 'address.com';
document.write('<a href="mailto:' + user + '@' + site + '">');
document.write(user + '@' + site + '</a>');
</SCRIPT>

Simply place this script in the same position in your document as your normal mailto link (i.e. where you want your address to appear). Replace 'your' with your e-mail login name and 'address.com' with your e-mail domain name, and there you have it, a simple solution to an online headache.


Updated 2020 : note that the above post is out-of-date, given this post was originally published in 2001, but is left here for archival purposes.