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.
The basic syntax with a recipient is:
<a href="mailto:[email protected]">Some text</a>
Adding a subject to that mail:
If you want to add a specific subject to that mail, be careful to add
+ 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.
Adding body text:
Similarly, you can add a specific message in the body portion of the email:
Again, spaces have to be replaced by
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:
Subject: Great news
Body: I am becoming a developer!
Your html link now:
<a href="mailto:?subject=Great%20news&body=I%20am%20becoming%20a%20developer">Send mail!</a>
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.
Adding more recipients:
Separate each email address with a comma to add additional recipients.
Additional parameters, such as cc and bcc, are preceded by