Jump to content

A Spamless Email Link


Recommended Posts

I recently found a Javascript that has cut my spam mail down dramatically. Unfortunately I don't remember where I saw it (probably in a TCH forum!) but I thought it would be a good addition here in the tutorials section.


The basic idea is that Javascript builds the link on the browser end in a way that spam searchers can't see it but regular folks can click on it and activate their normal email mechanisms just like with a mailto tag.


Spam emails dropped a lot about 1-2 weeks after I implemented it. The code below is set for my email address "webmaster@jimscomputing.com" so make sure you edit it accordingly.


To use it just go to a place in your website where you want an email link, or have one now, and replace the "<a href " with the script below. It will show up in your document as the actual email address and you can put text before and/or after the <script> and </script> tags to make the address show up in a sentence like "Contact us at..."


><script language="JavaScript">
user = "webmaster";
domain = "jimscomputing.com";
document.write('<a href=\"mailto:' + user + '@' + domain + '\">');
document.write(user + '@' + domain + '</a>');

Link to comment
Share on other sites

This topic is now closed to further replies.

  • Create New...