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


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

HTML Editors - How to Choose the Right One for Building Your Websites

There are lots of HTML editors on the market, however,... Read More

Trust Us! Sending Credible Messages

A company must earn and keep trust or sales don't... Read More

Warning: The Truth About Having a Web Site!

If you don't have a web site yet, are thinking... Read More

Effective Webdesign

D.zigns dzignerwebs The Basics Before starting on... Read More

How Worldly is Your World Wide Web?

The growth in Internet usage around the world is astounding... Read More

Free Webmaster Tools - 7 Things Every Webmaster Needs in Their Toolbox

Webmaster tools are vital to becoming both efficient and effective... Read More

Running An Effective Website

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

Streamline your Business Website with a Content Management System

I talk with so many people who have small businesses... Read More

Make Your Communication Come Alive

Design and layout can make your communication come alive and... Read More

The Birth of a Professional Web Site

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

But My Business Doesnt Need A Website!

Revenues are often lost because many business owners don't see... Read More

35% Revenue Increase? from Your Website!

2 Golden Rules for an Engaging Website35% of visitors fail... Read More

Five Steps to Create Your Software Product with Outsourcing

Many executives and investors are skeptical that software products can... Read More

Getting One-way Inbound Links: the 5 Major Strategies

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

Better Web Site ROI: Efficient Online Business with SEO, PPC, Split Testing, and Forums

If you're looking for better web site ROI, chances are,... Read More

How to Listen on the Web

When building a relationship, listening is more important than talking.A... Read More

Is Your Website Doomed for Failure Before Youve Built It?

One of the things that many people overlook when building... Read More

Building Websites with Directory Generator

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

7 Ways to Gain a Professional Online Reputation

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

Building eCommerce Websites that Work - Part 3

An interesting eCommerce success factor that isn't precisely overlooked, but... Read More

5 Ways to Build a Website

If you are like me you have wanted to build... Read More

Build It and They Will Come

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

Setting Up A CGI Script On Your Web Site

Before you set up any scripts you will need some... Read More

Earn On Offshore Web Design and Development

If you have some experience in web site design and... Read More

The Road to Better Results

A lot has changed in the way sites are optimized... Read More

PIM Team Case Study: Creating Text Effects With PHP and GD

See how you can create graphic effects on text with... Read More

Credibility - 10 Ways to Build it on Your Website

If you have your own business website and you are... Read More

High Quality Website at Low Cost

Although designing a great web site is an important part... Read More

MySQL Database Handling in PHP

Most interactive websites nowadays require data to be presented dynamically... Read More

Website Strategy!

A website lets you put your products in front 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

Web Site Promotion: How To Advertise Your Website For Profits

Making money with your web site is the dream and... Read More