I like to use the MailTo link on my website. It is handy for legitimate users to click a link and email me. The downside is that it's easy for the spam bots to harvest your email address from the page, and inundate you with penis enlargement, viagra and bad credit loan scams. I have been experimenting with different ways to insulate myself from this scourge and have come up with a pretty good mechanism for hiding my email addresses from the automated email address harvesters using Javascript.
The beauty of Javascript, is that it is only rendered on the client machine. Spam bots (email address harvesters) don't actually render the pages they visit. They simply downlad the page's markup, parse it for chunks of text that match the format of an email address, and then move on. By using Javascript to render the MailTo links on the client, we effectively mask the email address from the harvester. The bot doesn't see anything but some Javascript code, doesn't find it interesting, so skips it.
Here is an example.
<html>
<head>
<script >
function mailUs(user, dom, friendly){return '<a href=\"mailto:' + user + '@' + dom + '\">' + friendly + '<\a>';}
</script>
</head>
<body>
<p>Welcome to <a href="http://AnInternalPage.MyWebsite.com">An Internal Company Page.</a>.</p>
<p>This is where we provide company information for employees You must have a username and password in order to access the content here.</p>
<p>If you need to access this content, please <SCRIPT TYPE="text/javascript">
document.write(mailUs('postmaster', 'MyCompany.com', 'send us an email.'));</script>
<NOSCRIPT>
<em>enable JavaScript and refresh this page to contact us.</em>
</NOSCRIPT>
</body>
</html>
Using this technique you can provide a clickable MailTo link on your web pages, while protecting the email addresses of yourself and your users from spam abuse.