Protect Your Email Address

Posted by: John The Geek

Protecting your email address from spammers is something about which everyone should be fairly proactive. Most people don’t protect their email address, either because they don’t understand how to protect their email address or they’re too lazy to bother protecting their email address.

I learned the hard way that having my email address posted on my web sites simply invited spammers to come along and add it to their lists. I’ve had to discontinue using at least four different email addresses because the ratio of spam to useful content got too great.

It’s not difficult to “hide” your email address from the bad guys as long as you’re not aiming for 100% protection. Let’s face it, like locking your car, taking the basic precautions will only keep the amateurs and spambots honest. If somebody really wants to rip off your email address they’re going to and there’s nothing you can do about it short of not using the email address at all!

Many people believe that only using an email address for friends and family is sufficient to keep it private. That might work if you’re an only child and fairly unpopular. The larger your circle of friends and/or family, the greater the odds that one of them is going to have malware on their computer that swipes their entire address book.

Okay, so here are a few rules for protecting your email address:

Rule #1: don’t post it on public sites! This should be pretty obvious, but non-technical people often don’t know that the spambots that collect email addresses from public pages on the web can read email addresses posted in plain text. Yes, Virginia, they can read HTML text and grab anything that looks like a legitimate email address, e.g. webgenius@mywebsite.com. If you have to put your address out there in front of God and everybody, at least obfuscate it a little, as in the following example:

webgenius @ mywebsite dot com

Human beings can read that and figure out how to piece it back together correctly, but spambots aren’t typically that smart.

Rule #2: don’t use mailto: tags. If your link looks like this:

<a href=”mailto:webgenius@mywebsite.com”>My Email Address</a>

you may think you’ve cleverly hidden your email address under the displayed link text. Unfortunately, you’d be wrong. Spambots can read HTML, remember? One of the first things they’ll look for is the “mailto:” tag attribute. When they find one, they grab whatever text follows it. The odds are pretty good that it will be a legitimate and working email address, eh?

So, how do you protect your email address from the bad guys? There are a number of ways, some fairly simple, and some fairly complex. To a large degree it depends on how serious you are about it, and what the purpose of your web site is. I’ve tried a number of different things over the years, including writing my own Javascript utility that I had to include in every page I ever wrote that wanted to send email. It worked, but as it turned out, was overkill for the purpose for which I was using it.

The absolute simplest way to protect your email address is to simply display it in a non-standard way as mentioned above without using any sort of link tag with it. This is easy, but inconvenient for your web site visitors who have to not only translate your email address, but then type the correct version manually into their email client (hopefully, correctly!).

This next method involves some actual Javascript code, but despite the looks of it can be simply pasted into your web page wherever you want your email address to appear:

<script language=”JavaScript” />
<!– Begin
user = “webgenius”;
site = “mywebsite.com”;
document.write(‘<a href=\”mailto:’ + user + ‘@’ + site + ‘\” />’);
document.write(user + ‘@’ + site + ”);
// End –>

This will actually display your email address in standard format AND create a hyperlink so that people only need to click on it to send you an email. If you put this code into a page everyplace you want your email address to appear, when the page is displayed if you right-click and click View Source… you won’t see the mailto: tag attribute or the email address.

The advantage to this method is that your email address can be displayed correctly and linked for the convenience of your visitors. The disadvantage is that it’s a lot of code to have to paste in where your email address should be displayed. With that much code, it’s way too easy to goof something up that causes it not to work correctly. In fact, the person who sent me this code did exactly that and I had to find and fix the bug before I could get it to work!

If you have a business or professional site, the best way to handle this whole email address issue is to use a contact form. You’ve seen these on many web sites, I’m sure. There will typically be a Contact Us link that takes you to a page where there is a form you fill out with your question or problem, your name and email address, and submit to the customer service people for processing. This can be done fairly simply or with lots of bells and whistles. Either way requires some knowledge of HTML and a programming or scripting language such as Javascript or PHP.

If you’re not a programmer, but can install PHP scripts on your web site and add small amounts of Javascript code to your web pages, a really fine solution is My Contact Station. This is the script I use for the Contact Us on all my sites including this blog. My Contact Station is the script behind the Contact links at the top right of the sidebar. Go ahead and click on one of the links under Contact Us to see how My Contact Station works.

My Contact Station comes with complete installation instructions. If followed precisely, these instructions make installing My Contact Station easy for almost anyone. IMO, it’s the most elegant solution for a professional web site short of custom programming.

John The Geek

Like this post? Publish It On Your Own Blog

    

Leave a Reply

You must be logged in to post a comment.

  • Twitter Button from twitbuttons.com

  • Add to Technorati Favorites
  • Dilbert
  • Categories
  • Recommended!


     Powered by Max Banner Ads 

Copyright © 2008-2012 by Chon Resources - All Rights Reserved

Theme: WP Flex

Wordpress theme developed by Simpler Computing and others - Wordpress and WPMU Plugins, custom code and more.