Spam is a horrible thing. It is probably what annoys people the most about the internet. And for webmasters, owners / managers of websites, email spam can be horrific. For years spammers have been building “bots” that crawl the internet and seek out email addresses. As many people rely on email for their online business, this is very problematic. If you place your email on your site, you get inundated with so much spam you cannot spot the new customers. If you remove your email address, you lose customers, and lose trust.
The first solution to this was the contact form, which allowed new customers to fill out an enquiry form to send an email, usually using PHP mail servers on the webserver. But spammers learnt to hack these. Some people would resort to just writing their email (i.e. not using the mailto: HTML code that allows people to click the link to open their mail client). But then the spammers would learn to seek out any instances of @ followed by a domain and copy that from the page. To combat this, site owners then started using images to show their email, meaning clients would have to read and then manually type the email into the email client. Not customer focussed!
However, there is a more simplistic method that is very successful at stopping spammers. It is called Email Obfuscation, and luckily there are some tools online that do it for us. What is Email Obfuscation? Well, it is simply a way to use code to make your email appear differently to the bots, but still work as normal in the web browsers. Some people have used js (javescript) for this in the past, although more intelligent bots (ok, programmers) can now read these too. Client side javascript tricks can look like this:
<script type="text/javascript">
var name = 'user';
var at = '@';
var domain = 'example.com';
document.write(name + at + domain);
</script>
which simple displays the result of the “document.write part, i.e. the “user” followed by “@” and then “example.com” to create an email address.
The method that we prefer is known as Transparent name mangling, which involves replacing characters in the address with equivalent HTML references from the list of XML and HTML character entity references. Check out this email obfuscation tool (the second one down in the email one). Basically it will convert an email address into something that looks like this, but much longer (email address anchor changed for “contact me” in this example):
<a href="mo:jon@bmhs.com">Contact Me</a>
This is currently the best tool for disguising emails. We have been using this method for about 2 years and the email address we use is still spam free. Do not dismiss forms though, as there are some excellent contact forms available too. If you are looking for a form script, then we recommend that Dagon Design Contact Form.