Prevent Spammers from obtaining your email addresses

Use the following procedure to encode your email addresses using JavaScript code which will display the valid addresses only when the page is displayed within a web browser. This method is used to prevent Spammers and automated spam-bots from extracting your email addresses from the HTML code and mailto links from within your web pages. The following JavaScript code can be placed anywhere within the body of the document:

Single Email Address JavaScript Code:

For more information, please contact:
<script langauge="javascript">
<!--
var user = "name";
var domain = "yoursite.com";
document.write('<a href=\"mailto:' + user + '@' + domain + '\">');
document.write(user + '@' + domain + '</a>');
//-->
</script>

Single Email Address Displayed Results:

For further information, please contact:


Multiple Email Addresses JavaScript Code:

For further information, please contact the following departments:
<script langauge="javascript">
<!--
var user1 = "name1";
var user2 = "name2";
var user3 = "name3";
var domain = "yoursite.com";
document.write('<p>Sales: <a href=\"mailto:' + user1 + '@' + domain + '\">');
document.write(user1 + '@' + domain + '</a></p>');
document.write('<p>Customer Service: <a href=\"mailto:' + user2 + '@' + domain + '\">');
document.write(user2 + '@' + domain + '</a></p>');
document.write('<p>Technical Support: <a href=\"mailto:' + user3 + '@' + domain + '\">');
document.write(user3 + '@' + domain + '</a></p>');
//-->
</script>

Multiple Email Addresses Displayed Results:

For further information, please contact the following departments:

Single Email Address JavaScript Code Generator
Enter an email address in the text box below, then press the "Generate Code" button. The code will be displayed in a popup window. Finally, cut-and-paste the code into your document.


Sam Raheb
XLEcom Program Developer