A href mail
You're looking to create a link that opens a mail client with a pre-filled email address and subject!
The syntax for creating such a link is:
<a href="mailto:[email protected]?subject=Your%20Subject%20Here">Click to send email</a>
Here's a breakdown of the parts:
mailto:
- This is the protocol used to open a mail client.[email protected]
- The email address of the recipient.?subject=Your%20Subject%20Here
- This is the query string that sets the subject of the email. The%20
is an encoded space character, as spaces are not allowed in URLs.
You can also add other query string parameters to customize the email, such as:
[email protected]
- Adds a carbon copy recipient.[email protected]
- Adds a blind carbon copy recipient.body=This%20is%20the%20email%20body
- Sets the email body.
Here's an example with multiple query string parameters:
<a href="mailto:[email protected]?subject=Your%20Subject%20Here&[email protected]&[email protected]&body=This%20is%20the%20email%20body">Click to send email</a>
Keep in mind that the mail client used to open the link will depend on the user's default mail client and settings.