Do you want to hide the email address you use for your website to stop spammers from harvesting it?

If you want your viewers to be able to contact you, then you must have a “mailto” link containing your email address on your web pages.

But this causes a big problem: spammers want your email address. So they send out a robot with the mission of finding and capturing all the addresses it can. This is done by examining the HTML code used by browsers to render each webpage. All the bot has to do is save the email address it finds in your “mailto” link.

The two most common methods of “hiding” the email address:

* Munging. In this method, the email address is not put in a link. Rather it is supposedly hidden from the bots by substituting words for various parts of the address. Example: johndoe AT hotmail DOT com

* Encoding. The most common code used is standard ASCII code. Each letter or symbol in the email address is replaced by its equivalent. A simplified address a @ b.com would be coded as:

& #97; & #64; & #98; & #46; & #99; & #111; & #109; ( spaces were put in to prevent the browser from printing the actual address )

The “mailto:” link can still be used, because the browser will recognize the code and print out the real email address on the page.

But these methods no longer work.

I remember when these methods worked fine, but that is no longer the case. Hackers have “smartened-up” their robots, so they can now decrypt each of the above codes.

These two methods by no means exhaust the possibilities. A Google search on “hide email address” turns up over two million results. Even discounting duplicate methods, there are undoubtedly quite a few ingenious techniques available.

So what is the next step for me?

Without going through all of the Google entries, I can predict beyond a reasonable doubt that the method I use myself does a better job of protecting your email address than any other. How can I be so sure? Because I doubt that any hacker would have the time or skill to write a bot that would allow him to grab my email address — it’s that well hidden!

My method has the email address in the middle of a javascript, which is in turn located off the webpage itself, in a file that’s located in a different folder. So the robot would need to discover both the name of the folder and the name of the file. Yet even though the address is not located anywhere in the HTML code of the page, it DOES appear – almost like magic – on the page itself. But a robot doesn’t have eyes to see it!

I hear you saying, “But that’s impossible!” Well, it’s not. Just visit the website in the paragraph below, and you can find out how it’s done.

Visit the author’s website, Professor’s Coding Corner for some useful code snippets and tutorials on interesting facets of web programming. In particular, the article, Stop Spambots will show you the best way to protect your website.