|
Printer
Friendly
Local Government Webmasters Meeting Presentations
Three Methods for Protecting E-mail Addresses
Quinn Robinson, Municipal Research & Services Center
There are many programs that have been created that crawl the web in search of email addresses. Generally referred to as email address harvesters, these programs capture email addresses on Web pages and add them to their records. Some use these email addresses to send unsolicited email to the recipients. This leads to more spam in our inboxes. We can prevent this from happening in the first place by carefully protecting our email addresses on our public Web pages. In this guide, written by Quinn Robinson of Municipal Research and Services Center, we'll discuss three ways of hiding our email addresses. In addition to this, we'll be doing a test between now and the next meeting to see how effective these methods are. We'll report on the results of the test at the next meeting. Here are the methods.
Method One: HTML Encoding of E-mail Addresses
One method of obscuring your email address is to encode the ASCII text characters of your email address into code that will be rendered by the browser. This is a method to use if you wish to be able to click on an email address and have it open in a browser. Here is one email address generated like this:
ns1@mrsc.org
The HTML code for this email address and hyperlink is the following:
To encode your own email address in this format, please visit the following page. Scroll down to the bottom of the page, paste in your email address and hit "Encode". Your encoded email address will appear in the box. Then cut and paste this output into the code of an HTML page:
If you don't want to go to the trouble of encoding all of the email addresses on your site, you can do a search for all of the @ symbols on your site and replace them with @. Also, you can replace instances of the word mailto on your site with mailto. As most e-mail harvesters will be searching for "@" and "mailto" when they harvest Web pages, this may help your addresses to be passed over.
Method Two: Using HTML Comments to Hinder Harvesters
A second method for doing this involves using HTML comments to add additional information within an email address to make it harder to harvest off of a Web page. Unfortunately, using this method will not allow you to make the email address clickable. But it is easier to add to your site:
ns2@mrsc.org
The HTML code for this method is the following:
One note on this. You need to remove the hyperlink from all email addresses if you choose to use this method. This method may also be less effective than the other methods discussed in this article, according to our tests.
Method Three: Using JavaScript to Render E-mail Addresses
The last method we'll look at is a simple JavaScript that makes it harder for a spambot to read and harvest email addresses. There are more complicated JavaScript tools that use a combination of this approach and other approaches we have discussed above. But this will give you an example of the mechanics behind this approach. This email address should be correctly rendered by JavaScript enabled browsers:
The JavaScript code for this method is the following:
Summary
Prevention is always easier than repair. The methods and tools we have discussed will help you reduce spam in the inboxes of your organization. They will also help stop the spread of spyware and limit the effectiveness of email harvesting programs.
|