Email hyperlink syntax
The syntax for creating an email hyperlink is as follows:
mailto:<email address>?subject=<subject>&body=<body>
Here's a breakdown of each part:
mailto:
- This is the protocol used to open the email client.<email address>
- This is the email address of the recipient.?subject=<subject>
- This is the subject line of the email. You can include a default subject line by including thesubject
parameter.&body=<body>
- This is the body of the email. You can include a default body by including thebody
parameter.
Here's an example of a complete email hyperlink:
mailto:[email protected]?subject=Hello&body=Hello+from+the+web
When a user clicks on this link, their default email client will open with the subject line "Hello" and the body "Hello from the web".
You can also include additional parameters to customize the email hyperlink. Some common parameters include:
cc=<email address>
- This adds a carbon copy of the email to the specified email address.bcc=<email address>
- This adds a blind carbon copy of the email to the specified email address.to=<email address>
- This specifies an alternative email address for the recipient.attach=<file path>
- This attaches a file to the email.
Here's an example of an email hyperlink with additional parameters:
mailto:[email protected]?subject=Hello&body=Hello+from+the+web&[email protected]&[email protected]&[email protected]&attach=C:\Path\To\File.txt
Keep in mind that not all email clients support all of these parameters, and some may have different syntax requirements. It's always a good idea to test your email hyperlinks in different email clients to ensure they work as expected.