1. Technology

How to Create a Mailto Link

Email Links on Your Website - Part 2


Email @-sign - Image © Michael Bretherton
Image © Michael Bretherton

Mailto links are links on web pages that instead of pointing to a web page URL or anchor, they point to an email address. Then when a reader clicks on the link, an email client opens and they can send a message to that email address. They are a great way to provide a contact option on your website.

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

<a href="mailto:webdesign@aboutguide.com">Send email to the Web Design Expert</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@aboutguide.com,email2@aboutguide.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 URL. 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 (write this all on one line, and remove the » characters):

<a href="mailto:html@aboutguide.com? »
bcc=gethelp@aboutguide.com »

But using mailto links can lead to spam. Many spam programs are out there that surf websites 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.

Previous Page > Why Contact Information is Critical for a Website
Next Page > Using Web Forms for Contact Mail > The Web Design @ About.com Contact Solution

Most Recent Web Design Articles

Related Video
Link a Website to an Email Address in HTML

©2014 About.com. All rights reserved.