2018-10-12 15:37:13 -04:00
---
title: Mailto Links
---
## Mailto Links
2019-03-19 20:05:33 -06:00
A mailto link is a hyperlink (`<a href=""></a>` ) with parameters that let you specify additional recipients, a subject line, and/or a body text.
2018-10-12 15:37:13 -04:00
### The basic syntax with a recipient is:
```html
<a href="mailto:friend@something .com">Some text</a>
```
### More customization!
#### Adding a subject to that mail:
If you want to add a specific subject to that mail, be careful to add `%20` or `+` everywhere there's a space in the subject line. An easy way to ensure that it is properly formatted is to use a [URL Decoder / Encoder ](https://meyerweb.com/eric/tools/dencoder/ ).
#### Adding body text:
Similarly, you can add a specific message in the body portion of the email:
Again, spaces have to be replaced by `%20` or `+` .
2019-03-19 20:05:33 -06:00
After the subject parameter, any additional parameter must be preceded by `&` .
Example: To enable a user to send an email to their friends about their progress at Free Code Camp:
2018-10-12 15:37:13 -04:00
Address: empty
Subject: Great news
2019-03-19 20:05:33 -06:00
Body: I am becoming a developer!
2018-10-12 15:37:13 -04:00
Your html link now:
```html
<a href="mailto:?subject=Great%20news&body=I%20am%20becoming%20a%20developer">Send mail!</a>
```
2019-03-19 20:05:33 -06:00
In this instance we have left mailto empty (mailto:?) which will open the user's email client and the user will add the recipient's email address.
2018-10-12 15:37:13 -04:00
#### Adding more recipients:
2019-03-19 20:05:33 -06:00
Separate each email address with a comma to add additional recipients.
2018-10-12 15:37:13 -04:00
2019-03-19 20:05:33 -06:00
Additional parameters, such as cc and bcc, are preceded by `&` .
2018-12-13 21:13:18 -07:00
2018-10-12 15:37:13 -04:00
```html
<a href="mailto:firstfriend@something .com?subject=Great%20news&cc=secondfriend@something .com,thirdfriend@something .com&bcc=fourthfriend@something .com">Send mail!</a>
```
#### More Information:
[MDN - E-mail links ](https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Creating_hyperlinks#E-mail_links )