Email Addresses in Web Pages

You want to give your site's visitors a way to contact you by email but don't want your emali address to be abused. Here are a few ways to protect your email address when building your website.

1. Use defined users and filters

Don't use the catch all email facility. Instead define users such as enquiry@ or sales@. It's better if you can avoid the most obvious ones like info@ as some people might speculatively try these. It's best to use a person's name which does not appear elsewhere on the site.

Most email providers or email software offer you filters to use on incoming email. You define a parameter in the email and then filter out any incoming mail which does not contain it. For example, you could set your email link as mailto:info@companyname.com?body=security%20code%20123%20 (please%20leave%20intact%20in%20message%20body) then filter out any mail which does not contain the text "security code 123". Please note that a space is replaced by "%20" ni the mailto parameter.

This will prevent email from automated systems but you could miss out on genuine mail if the sender fails to understand this measure. Be sure to explain it well on your contact page.

It is important when using filters on an address that you don't use this address to send other mail as your replies could be filtered out. Keep one address purely for email from your website.

2. Use a form

Use a form for your site's visitors to contact you. This hides the email address in the browser but it may still appear in the HTML coding. If it does yuo can get around this by defining a subject line, e.g. info@companyname.com?subject=enquiry and filtering out all incoming mail which does not have this subject line.

3. Use JavaScript for links

It is possible to write the text link in JavaScript instead of HTML. The script breaks the email address down into its elements and then puts it back together. It appears just as a normal HTML link in the browser even down to the way it appears in the browser's status bar. This method keeps everything looking as the visitor would expect but protects your address from Spam harvesters, programs designed to crawl sites and find mailto links in the code.

Copy this code replacing the 4 variables user, domain, extension and link with your own information. This example uses the made up email address info@companyname.com. It should be obvious which parts to change and to what.

[script language="JavaScript" type="text/javascript"][!--

var user = "info";
var domain = "companyname";
var extension = "com";
var link = "Email Us";

document.write('[a href="mailto:' + domain + '.' + extension + '"]'); document.write(link + '[/' + 'a]');
// --][/script]

Please note that the square brackets must be replaced with angled brackets for the script to work. The square brackets are merely to enable me to display the coding here.

Chris Smith is a full time web developer building websites for small businesses and individuals.

Please visit his site to see live examples of these techniques in action and for further information on web design and development.

Web Development | Email Links

In The News:


pen paper and inkwell


cat break through


Top 7 Tips for Building an Antique Car Website

Like wine cars get more attractive to collectors as years... Read More

6 Steps To Your Own Website

A lot of people these days are interested in getting... Read More

Set Up Your Website in Minutes ? For Free

There was a time not long ago when setting up... Read More

Running An Effective Website

Running an effective website is a continuous process. I have... Read More

Why do I Need a Website?

Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More

Getting One-way Inbound Links: the 5 Major Strategies

With search engines putting a damper on direct reciprocal links,... Read More

Guide to Internet Business - Website Setup

After planning the design and content of your website, it's... Read More

Make Your Web Site Stand Out

When visitors add your web site to their Favorites or... Read More

WYSIWYG Versus Coding: HTML With A Purpose

After years of working with entrepreneurs who developed their first... Read More

How One Word Or Even One Letter Can Boost Conversion Rates By Over 400%!

Recently I was reviewing the keyword specific conversion rate data... Read More

A Network Of Web Sites Is Not Enough!

The big thing these days is your ability to capture... Read More

Conceptualize, Build and Publish a Web site

Conceptualize, Build and Publish a Web site - What's required... Read More

New Years Resolutions: Is Improving Your Website One of Them?

With the New Year upon us yet again, it's time... Read More

PHP Redirect

A PHP Redirect automatically transfers a web user from one... Read More

Remember This When Building A New Site - Beginners Guide

I recently helped my mom to launch a website (www.mom2me.com)... Read More

What Works and What not Works for Your Internet Business

"Build it and they will come."--Filed of Dreams (1989) If... Read More

4 Marketing Tips for Resourceful Webmasters!

The internet is a sea of knowledge. Getting your information... Read More

What is The Google Toolbar?

No matter what browser you may want to use, you... Read More

The Power Of CPanel

cPanel is a control panel for your website and allows... Read More

Creating a Sticky Web Site

When used to describe a web site, the term "sticky"... Read More

Free Websites & Why You Should Avoid Them

It amazes me how many people try to build serious... Read More

Develop a Solid Website Presence

Starting an internet business can be confusing to non-veterans. The... Read More

The 2 Most Common Web Site Mistakes

When we review the sites of potential clients, there are... Read More

Your Biggest Mistake When You Create a Website?

--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More

Abandonment - Why Visitors Don?t Turn Into Customers

Every good Internet business understands the value of conversions versus... Read More

How Does Your Website Make Me Feel?

When people think about the Internet, they think about technology.... Read More

Web Site Optimization: How To Speed Up Your Web Site By Minimizing Your GIF and PNG Image Bit-Depth

Are bloated images slowing down your web site and causing... Read More

How To Make Your Website More Successful? (Part I)

Building a website and getting it online is easy. Driving... Read More

Live Support from Your Website? Can You Do It for Free?

I'm a freelance programmer and somehow I managed to get... Read More

Selecting a Web Content Management Product

So you want to take a look at a real... Read More

Bring Your Visitors Back Clamoring for More! Maintain and Improve Your Web Site Weekly - Part 1

80% of your Web site is Maintenance!Once your Web site... Read More

Maintaining Your Business Website

QUESTION: Should I build and maintain my business Web... Read More

I Want To Be A Freelancer

So you have decided that you want to do freelance... Read More