Adding the subject to the mailto HTML tag is an easy way to help direct e-mails when listing more than one e-mail address on your website or blog.
Using the mailto in the a href HTML tag lets you send an e-mail using the installed e-mail client. If you want to add a subject to that e-mail add ?subject=
For example, the complete tag would look similar to the example below.
You can also add body text by adding &body=body to the end of the tag, as shown in the example below.
You can also include &cc= or &bcc= to fill out the CC and BCC fields.
Examples
First Example
Keep in mind that if you are using a web mail service such as Yahoo! mail or Gmail it will not open these services to start an e-mail. These links are only designed to send e-mail from the installed e-mail client, such as Outlook and Thunderbird.
Second Example
Related information
- Additional information about the mailto protocol is on RFC 2368.
- How to create a mail link on a web page.
- HTML and web design help and support.