PageResource.com - Web Development Tutorials

The E-Mail Link: More

More tricks for the email link
In the last section, we saw how to add the subject to a message through the e-mail link. It was done using a "question mark" followed by subject= and then the subject:

<a href="mailto:you@you.com?subject=Hi">Mail Me</a>

On top of adding the subject, there are a couple of extras you can also add. You can add a carbon copy recipient, a blind carbon copy recipient, or use a combination of the subject with either or both of these.

To send a carbon copy, you add the cc= command after the question mark, followed by the e-mail address of the person you want to send the carbon copy to:

<a href="mailto:you@you.com?cc=friend@friend.com">Mail Me</a>

The same goes for a blind carbon copy, except you use the bcc= command instead:

<a href="mailto:you@you.com?bcc=friend@friend.com">Mail Me</a>

With either of these, you can send the copies to multiple addresses by separating them with commas:

<a href="mailto:you@you.com?bcc=friend@friend.com, other@other.com">Mail Me</a>

Now, if you want to combine more than one of these commands after the question mark, you add them in using an "&" sign at the end of the first command. For instance, if you want a subject and a blind carbon copy, it would look like this:

<a href="mailto:you@you.com?subject=Hi&bcc=friend@friend.com">Mail Me</a>

If you want all three, use the "&" sign again:

<a href="mailto:you@you.com?subject=Hi&bcc=friend@friend.com&cc=other@other.com">Mail Me</a>

With that, you can have some more fun with your e-mail links— and if you run a site with a partner you can both get an e-mail when someone uses that link.

All right, let's go to the next section, Congrats!.


Copyright © The Web Design Resource. All rights reserved. | Contact Us | Privacy Policy