1. Home
  2. Computing & Technology
  3. Web Design / HTML

Creating a Mailto Link
Email Links on Your Web Site

By , About.com Guide

Email @-sign - Image © Michael Bretherton

Image © Michael Bretherton

To create a link on your Web site that opens an email window, you simply use a "mailto:" link. For example:

<a href="mailto:html.guide@about.com">Send email to your HTML Guide</a>

But what if you want to send email to more than one address? If you just want to send it To: multiple people, simply separate the email addresses with a comma. For example:

<a href="mailto:email1@about.com, email2@about.com">

But there's more, you can also set up your mail link with a cc, bcc, and subject. Treat these elements as if they were arguments on a CGI. First you put the To address as above. Follow this with a question mark (?) and then the following:

  • cc=emailaddress for a Cc
  • bcc=emailaddress for a Bcc
  • subject=subject text for a Subject

If you want multiple elements, separate each with an ampersand (&). For example:

<a href="mailto:html.guide@about.com? »
bcc=gethelp@about.com »
&subject=testing">

But using mailto links can lead to "spam". Many spam programs are out there that surf Web sites harvesting email addresses. In fact, that's one of the most common ways that spammers get email addresses. And even if you don't get a lot of spam, or have a good filter, you might still get more email than you can handle. I know that some of the About.com Guides get more than 100 non-spam email messages a day.

In this situation, it can be helpful to pre-sort the email with a Web form. Using a form also has the advantage of not (always) printing an email address on the Web page for spammers to harvest.

Next Page > Web Forms for Contact Mail > Page 1, 2, 3, 4

Previous Features

Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. Beginning HTML Tutorials
  6. Creating a Mailto Link - Linking to Email on Web Pages>

©2009 About.com, a part of The New York Times Company.

All rights reserved.