Hochman Consultants - Results Driven Internet Marketing
Client Login

Prevent Spam by Encoding Email Addresses

Email spam is a major problem for enterprises and individuals because it can lead to fraud, identity theft, computer viruses, and wasted time. In addition, misconceived efforts to block spam with overly aggressive filtering can inconvenience legitimate email contacts.

How do spammers get your email address? Sometimes they guess, or they can steal it from a computer that has been compromised. More frequently, they simply collect addresses from web sites using automated programs called spambots.

You can virtually eliminate Email spam by choosing a good Internet Service Provider (ISP), the right web site programming, and the right email software.

How to eliminate spam:

  • Ask your email provider to use Spam Assassin or switch to Gmail.
  • Use Javascript to display any email addresses on your web site. Spambot programs try to collect many email addresses by crawlings lots of pages. They do not bother to interpret Javascript because it would take much longer, and therefore reduce their profitability.

This simple Javascript function will fool virtually all email address harvesting programs:

<head>
<!--snip-->
<script type="text/Javascript> <!--
//Generates a mailto link "name@domain.tld"
function contact(domain, name, tld) {
document.write('<a href=\"mailto:' + name + '@' + domain + '.' + tld + '\">')
document.write(name + '@' + domain + '.' + tld + '</' + 'a>') } // --> </script> </head> <body> <!--snip--> <script type="text/Javascript> <!-- contact("whitehouse", "george.washington", "gov"); // --> </script> </body>

The above code would generate george.washington@whitehouse.gov.

About the Author

After graduating from Yale with two degrees in Computer Science, Jonathan Hochman set up his own consulting company in 1990. He has been an Internet marketer since 1994. To send feedback, please visit http://www.hochmanconsultants.com/.

Creative Commons License You may distribute this article in its entirety under a Creative Commons Attribution 3.0 License. Please attribute the author by name and link (URL).

For additional information, please contact Hochman Consultants.