Email links remain one of the simplest ways to let visitors contact a business, publication, or support team. A correctly built mailto link opens the user’s default email application and can prefill fields such as the recipient, subject line, copied recipients, and even part of the message body. However, small mistakes in formatting can lead to broken links, unreadable subjects, privacy problems, or inconsistent behavior across devices.
TLDR: Use mailto: links when you want a click to open an email draft, and add a subject with the ?subject= parameter. Always encode spaces and special characters, and use & between additional parameters in HTML. Keep subjects short, test links across major devices, and avoid exposing sensitive addresses where spam harvesting is a concern.
Contents
- 1 What a mailto link does
- 2 How to add a subject line
- 3 Adding more fields correctly
- 4 Best practices for subject lines
- 5 Encoding rules that prevent broken links
- 6 Multiple recipients, CC, and BCC
- 7 Accessibility and visible link text
- 8 Limitations of mailto links
- 9 Testing before publishing
- 10 A reliable example
What a mailto link does
A mailto link is a hyperlink that starts with the mailto: scheme instead of https://. When a user clicks it, the browser asks the operating system which email program should handle the request. That may be Apple Mail, Outlook, Gmail in the browser, Thunderbird, or another configured app.
The most basic version looks like this:
<a href="mailto:contact@example.com">Email us</a>
This creates a link labeled Email us. Clicking it opens a new message addressed to contact@example.com. It is simple, readable, and widely supported.
How to add a subject line
To prefill the subject line, add a question mark after the email address, followed by the subject parameter:
<a href="mailto:contact@example.com?subject=Website%20Inquiry">Email us</a>
In this example, the subject becomes Website Inquiry. Notice that the space is written as %20. This is called URL encoding, and it is essential for reliable mailto links. Spaces, ampersands, question marks, line breaks, and many punctuation marks have special meanings in URLs. If they are not encoded, the email app may misread the link.
For example, the subject Question about pricing & availability should be encoded like this:
Question%20about%20pricing%20%26%20availability
A correct HTML link would be:
<a href="mailto:sales@example.com?subject=Question%20about%20pricing%20%26%20availability">Contact sales</a>
Adding more fields correctly
Mailto links can include more than a recipient and subject. Common parameters include:
subject: prefilled email subject linecc: carbon copy recipientsbcc: blind carbon copy recipientsbody: prefilled message text
The first parameter begins with a question mark. Additional parameters are joined with an ampersand. In HTML, that ampersand should be written as & in the source code, which appears as & when interpreted.
Example:
<a href="mailto:support@example.com?subject=Support%20Request&body=Please%20describe%20your%20issue%20here.">Request support</a>
This opens a message addressed to support, with a subject and a short body prompt. If you want line breaks in the body, use %0D%0A, which represents a carriage return and line feed:
body=Name:%0D%0AOrder%20number:%0D%0AIssue:
This can make the draft easier for users to complete. Still, use prefilled body text carefully. Long or overly detailed templates may feel intrusive and may not display consistently in every email client.
Best practices for subject lines
The subject line should help both the sender and the recipient. It should be clear enough for sorting and tracking, but not so long that it is truncated. A serious business website should treat subject text as part of the user experience.
- Keep it concise: Use phrases such as Support Request, Partnership Inquiry, or Invoice Question.
- Avoid vague wording: Subjects like Hello or Important provide little context.
- Do not include private data: Avoid putting account numbers, medical details, or personal identifiers in the subject.
- Use consistent categories: If several links go to the same team, standardized subject lines can help automate filtering.
Encoding rules that prevent broken links
Encoding is the area where many mailto links fail. A browser can only interpret the link correctly if reserved characters are represented safely. The following are common examples:
- Space:
%20 - Ampersand:
%26 - Question mark:
%3F - Comma:
%2Cwhen used inside text rather than between recipients - Line break:
%0D%0A
For HTML specifically, remember that parameter separators should use & in the markup. For instance:
<a href="mailto:info@example.com?subject=General%20Inquiry&cc=manager@example.com">Send an inquiry</a>
This distinction matters because HTML has its own rules in addition to URL rules. Writing raw ampersands may work in some browsers, but it is not the correct or most dependable approach.
Multiple recipients, CC, and BCC
You can address more than one recipient by separating addresses with commas:
mailto:editor@example.com,news@example.com
You can also add copied recipients:
<a href="mailto:team@example.com?cc=manager@example.com&subject=Project%20Update">Send update</a>
Be cautious with BCC. Some email clients may ignore it, and automatically adding hidden recipients can raise trust and transparency concerns. For most public websites, it is better to route messages through a shared inbox or contact form rather than relying on hidden copies.
Accessibility and visible link text
A mailto link should make sense before it is clicked. Avoid generic text such as click here. Use descriptive link text that tells users what will happen:
- Good:
Email customer support - Good:
Contact the press office - Weak:
Click here
It is also useful to show the email address in the visible text when appropriate. Some users prefer copying the address manually, especially if they are on a shared computer or do not have a default email client configured.
Limitations of mailto links
Mailto links are convenient, but they are not a complete replacement for contact forms. Their reliability depends on the user’s device configuration. If no email app is set up, the link may do nothing useful. On mobile devices, the experience can vary by operating system and installed apps.
There is also a spam consideration. Publishing plain email addresses can make them easier for automated scrapers to collect. If spam volume is a major concern, consider using a contact form, a protected support portal, or server-side routing. For public-facing contact links, monitor the inbox and apply appropriate filtering.
Testing before publishing
Before adding mailto links to a live website, test them as carefully as any other user-facing feature. At minimum, check:
- whether the link opens the expected email application;
- whether the recipient address is correct;
- whether the subject displays exactly as intended;
- whether spaces, punctuation, and special characters appear correctly;
- whether body text and line breaks work on desktop and mobile;
- whether the link remains readable for screen readers and keyboard users.
Testing is especially important when a link includes multiple parameters. A single unencoded ampersand or question mark can break the rest of the link.
A reliable example
Here is a practical, well-structured mailto link:
<a href="mailto:support@example.com?subject=Account%20Support%20Request&body=Hello,%0D%0A%0D%0APlease%20describe%20your%20request%20below:%0D%0A">Email account support</a>
This example uses a clear recipient, a concise subject, properly encoded spaces, HTML-safe parameter separation, and a short body prompt. It does not include sensitive information, excessive instructions, or hidden recipients.
Used correctly, mailto links with subject lines are dependable, efficient, and user-friendly. The key is to keep them simple, encode them properly, and test them in real conditions. A carefully written email link can reduce friction for visitors while helping your organization receive clearer, better-categorized messages.
