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


6 Steps To Your Own Website

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

Creating a Sticky Web Site

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

Building a Web Store on Shoestring Budget in less than Four Hours

Starting a business online is no longer as difficult as... Read More

Have You Got Your Ear To The Ground Or Your Head In The Sand?

What happened on your website yesterday? What about last week... Read More

Disability Discrimination Act (DDA) & Web Accessibility

There's been widespread speculation about the new legislation being introduced... Read More

Planning A Usable Website: A Three-step Guide

A website is like an information flow, with you as... Read More

Increase Your Affiliate Earnings with a Smart Webmaster Plan

Affiliate programs are a great way to earn an income... Read More

7 Ways to Gain a Professional Online Reputation

A professional online reputation is essential to the flourishing of... Read More

Websites: You Get What You Pay For!

So you finally decided to invest in a web presence... Read More

The Topic Of Your Website

The first thing you will have to deal building your... Read More

Top 7 Tips for Building an Antique Car Website

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

Tell me what your website does!

You know exactly what your organisation does and what your... Read More

The Birth of a Professional Web Site

The Internet has opened a whole New World of opportunity... Read More

Having a Domain Name And Web Site Gives Your Business The Key To The Door

Just like all things in life, the ways to run... Read More

10 Simple Steps: Its Magic If You can E-Mail You can Update Your Web Page Dynamically

Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More

Growing Your Meetings In CyberSpace

As increasing numbers of people search for information on the... Read More

Guidelines for Web Page Optimization

Below, I have listed 8 simple steps that you can... Read More

Up The Sandbox!

Go to any internet marketing forum you want these days... Read More

The Power Of CPanel

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

Building Websites with Directory Generator

Directory Generator, a product from Armand Morin and Marc Quarles,... Read More

Build It and They Will Come

Build it and they will come is not always true;... Read More

How Did You Get Here?

When marketing your website, it's important to know which of... Read More

Topics to Add When Creating an Alternate and Modern Medicine Web Directory

Alternate medicine finds its own place in the hearts and... Read More

How to Get a Knock Out Website!

The first step in setting up an online business...Starting an... Read More

Whats Your Business Online Attitude?

This article was prompted by some customer support work I... Read More

1 Simple Solution to All Internet Marketers about Their Website Design Needs

It is an undeniable fact that not everybody is keen... Read More

For Newer Sites, Web Marketing Depends On Titles & Links!

We all start out the same. Some have budgets, some... Read More

The Internet Road Map

1) Data CaptureOne easy way to collect e-mail addresses and... Read More

Web Design for the Professional Magician Part I - Selecting the Perfect Domain Name

Selecting the Perfect Domain NameThe first issue I have with... Read More

Web Designer? You Dont Need No Stinkin Web Designer!

RIVERSIDE, CA August 4, 2004 ?- "Historically, small business owners... Read More

Why Your Business Needs a Website

Even with the steady growth of the World Wide Web,... Read More

4 Steps to Selling More With Your Web Site

Most web sites are more like stage sets than real... Read More

7 Killer Ways To Increase Your Online Sales

Every online entrepreneur I talk to is asking the same... Read More