Why a plain mailto link is not always enough
Most websites have at least one email link. It sits in the footer, on the contact page or in a support article, and it usually does the bare minimum: it opens a blank message addressed to one inbox. That works, but it leaves the person writing to you with a blank subject line and an empty body, and it leaves your team guessing what each incoming message is about.
A small amount of pre-filled text changes that. A subject such as Billing question or Partnership enquiry lets a shared inbox sort messages before anyone reads them. A short body template can prompt the sender for an order number, a website address or the browser they are using, which saves a round of back-and-forth replies. Adding a cc address can make sure a second team sees the request from the start.
The catch is that mailto links are a kind of URL, and URLs have strict rules about which characters are allowed. A space, a line break or an ampersand typed directly into the link can cut the subject short, drop the body entirely or confuse the mail app. This guide walks through the syntax, the encoding rules and the practical limits, so the links you publish open the message you intended.
How a mailto link is built
Every mailto link has the same three parts. First comes the scheme, mailto: with a colon and no slashes. Then comes one or more recipient addresses. Finally there is an optional query string that starts with a question mark and holds the extra fields, separated by ampersands. The format is described in RFC 6068, the standard that defines the mailto scheme, and every major mail client follows it closely enough for everyday use.
Here is a link that fills in everything most people need:
mailto:support@example.com?subject=Order%20question&body=Hi%2C%20my%20order%20number%20is%3A&cc=billing@example.com
When someone clicks it, their mail app opens a new message to support@example.com, with billing@example.com in the cc line, the subject Order question and a body that reads Hi, my order number is: ready for them to finish. Nothing is sent until the visitor presses send themselves. The link only prepares a draft.
The fields you can set
| Field | What it fills in | Example value |
|---|---|---|
| (address after mailto:) | The To line | support@example.com |
| subject | The subject line | Order%20question |
| body | The message text | Hi%20team%2C |
| cc | Visible copy recipients | billing@example.com |
| bcc | Hidden copy recipients | records@example.com |
| to | Extra To recipients, added to the address in the path | sales@example.com |
The field names are not case-sensitive in most clients, but lowercase is the convention and the safest choice. The order of the fields after the question mark does not matter. You can put body before subject or cc last, and the result is the same.
Only the first question mark in a mailto link has a special meaning. Every later field must be joined with an ampersand. A second question mark is a common mistake, and it usually turns the rest of the link into part of the previous value.
Adding a subject line
The subject is the field people reach for first, and it is also where most broken links start. The rule is simple: anything other than letters, numbers and a handful of safe punctuation marks needs to be percent-encoded. In practice that means spaces, commas, colons, ampersands, question marks, hash signs, quotes and any accented or non-Latin characters.
A subject like Quote request: 3 pages becomes Quote%20request%3A%203%20pages in the link. It looks awkward to read, but the mail client decodes it back into normal text before the visitor sees it. If you leave the spaces as they are, many browsers will still fix them silently, but some content systems, email signatures and document editors will break the link at the first space, so the subject ends after the word Quote.
Keep the subject short and descriptive. It is meant to help with sorting and routing, not to carry the whole message. The same guidelines that apply to campaign subjects apply here, and our article on how long an email subject line should be explains why shorter subjects stay readable on phones and in narrow inbox views.
Good uses for a pre-filled subject
- Routing to the right person in a shared inbox, for example Support, Sales or Press.
- Labelling where the message came from, such as Pricing page enquiry or Footer contact.
- Matching a filter rule in your mail system so messages land in the correct folder automatically.
- Adding a reference that helps the reply, such as a product name or a document title.
Pre-filling the body
The body field drops text into the message area of the new email. It is useful for short prompts that make a reply easier to write, and it is the field where encoding matters most, because a body often contains commas, line breaks and punctuation.
A mailto body is always plain text. You cannot add bold text, links that display as anchor text, images, tables or signatures through the link. Anything that looks like HTML will appear as raw tags in the message. If you need formatting, the mailto scheme is the wrong tool, and a web form or a help desk widget is a better fit.
Line breaks
To start a new line in the body, use %0D%0A, which is the encoded form of a carriage return followed by a line feed. Some clients accept %0A on its own, but the full pair is what the standard expects and it works in the widest range of apps. Two of them in a row create a blank line between paragraphs.
For example, body=Name%3A%0D%0AOrder%20number%3A%0D%0AQuestion%3A produces a short form inside the email:
- Name:
- Order number:
- Question:
That kind of template is where pre-filled bodies earn their place. It tells the sender exactly what you need, and it keeps every message in the same shape, which makes them faster to read and easier to search later.
Do not put personal or sensitive details in a mailto link that you publish. The link is visible in the page source, can be saved in browser history and may be copied into other documents. Pre-fill prompts and labels, not customer data.
Encoding characters correctly
Percent-encoding replaces a character with a percent sign and its two-digit hexadecimal code. It exists because some characters have a job inside a URL. A question mark starts the query string, an ampersand separates fields and a hash sign starts a fragment. If one of those appears inside your subject or body without encoding, the client reads it as structure, not as text.
| Character | Encoded form | What goes wrong if you skip it |
|---|---|---|
| Space | %20 | The link may end at the first space in some editors |
| Line break | %0D%0A | Line breaks are lost or the link breaks apart |
| & | %26 | The text after it is read as a new field |
| ? | %3F | Can be confused with the start of the query string |
| # | %23 | Everything after it is treated as a fragment and dropped |
| % | %25 | Treated as the start of another encoded character |
| + | %2B | Some clients turn a literal plus sign into a space |
| , | %2C | Usually fine, but encoding avoids edge cases in recipient lists |
You can encode text by hand once you know the common codes, but it is easy to miss one character in a long body. A URL encoder converts a whole phrase in one step, and it also works in reverse when you need to read an existing link and check what it actually contains.
Why %20 and not a plus sign
In web forms and many query strings, a plus sign stands for a space. Mailto links follow different rules. The mailto standard treats a plus sign as a literal plus, and while some apps convert it to a space anyway, others show it exactly as typed. A subject written as Order+question can therefore arrive as Order+question in one mail app and Order question in another. Using %20 removes the doubt.
The reverse matters too. Plus signs appear in real email addresses, especially where people use plus addressing to tag sign-ups, such as name+news@example.com. Encoding a plus sign inside a body or subject as %2B keeps it intact in every client.
Adding cc, bcc and several recipients
A link can address more than one person. Put several addresses after mailto: and separate them with commas, as in mailto:sales@example.com,support@example.com. Older advice sometimes suggests semicolons, because some desktop clients accept them, but the standard separator is the comma and it is the most reliable choice.
The cc and bcc fields take the same comma-separated format. A link such as mailto:support@example.com?cc=manager@example.com&bcc=archive@example.com opens a message with all three addresses in the right places. Visitors can see and edit every field before they send, including the bcc line, so bcc is not a way to hide anything from the person writing the email. It only hides the bcc recipients from the other recipients.
Check the addresses before you publish
A typo in a mailto link is easy to miss, because the link still opens a message. The visitor fills it in, presses send and gets a bounce, or worse, the message goes to a stranger with a similar address. Run every address through an email syntax checker before it goes on a page, and send a short test to each inbox the link uses.
- Confirm there are no spaces before or after an address, especially when it was copied from a spreadsheet or a document.
- Look for lookalike mistakes, such as a missing letter in the domain or a comma where a dot should be.
- Make sure every inbox in the link is monitored. A cc address that nobody reads creates a false sense that a message was seen.
- Avoid long recipient lists. A link that copies five people on every enquiry is usually better handled by a forwarding rule on the server.
Building a link step by step
Writing a link by hand is a good way to understand the format, but for anything you publish it is faster and safer to build the link with a tool and then test it. The Mailto Link Generator takes the recipient, subject, body, cc and bcc as plain text, encodes them correctly and can return either the raw link or a ready HTML anchor. It runs in the browser, so the addresses and text you type are not uploaded.
- Decide what the link is for: one inbox, one topic and the information you want people to include.
- Enter the To address. Add extra recipients only if each of them really needs every message.
- Write a short subject that names the topic and, if useful, where the message came from.
- Write a brief body prompt. Two to four lines, such as a greeting and the details you need, is usually enough.
- Add cc or bcc addresses if a second team must see each message from the start.
- Generate the link and read the result. Check that spaces appear as %20 and line breaks as %0D%0A.
- Click the link on a desktop computer and on a phone, and confirm that each field fills in as expected.
- Publish the link with clear link text and the plain email address shown nearby.
Using the link in HTML
In a web page, the link goes inside the href attribute of an anchor, for example <a href="mailto:support@example.com?subject=Website%20enquiry">Email our support team</a>. Inside HTML, an ampersand between fields can be written as & so the markup stays valid. Browsers turn it back into a plain ampersand before opening the mail app, so both forms work, but the encoded form is the cleaner habit in hand-written HTML.
Most site builders and content systems have a link field that accepts a mailto address directly. Paste the full generated link there rather than typing the address alone, and the subject and body will come along with it.
Limits and compatibility
Mailto links are old, widely supported and simple, but they depend entirely on the visitor's device. The link does not send anything. It asks the operating system to open whatever app is registered to handle email, and that is where most real-world problems come from.
No mail app set up
Many people read email in a browser tab and never configure a desktop mail app. When they click a mailto link, one of three things happens: nothing at all, a setup wizard for a mail program they do not use, or a prompt asking which app should handle the link. Some webmail services can be registered as the default handler, but you cannot count on visitors having done it.
The practical answer is to show the email address in plain text next to the link, so anyone can copy it into the mail service they prefer. A short note such as Opens your email app also sets expectations and helps people using screen readers understand what will happen when they activate the link.
Link length
There is no single official maximum length for a mailto link, but very long links fail in practice. Some desktop clients and older browsers truncate links somewhere around two thousand characters, and long encoded bodies grow quickly because every space and line break takes three or six characters. A good rule is to keep the full link well under that, which in practice means a one-line subject and a body of a few short lines.
Other things the scheme cannot do
- It cannot attach files. Any attachment parameter you find in old forum posts is ignored by modern clients.
- It cannot choose the sending account. The visitor's default account is used.
- It cannot set a reply-to address, priority or read receipt in a reliable, cross-client way.
- It cannot confirm that a message was sent. You only know a link was clicked, and only if you measure clicks separately.
| Situation | Mailto link | Contact form or help desk |
|---|---|---|
| Quick contact from a footer or signature | Good fit | Often more than needed |
| Structured requests with required fields | Works for prompts, cannot enforce answers | Better fit |
| File uploads or screenshots | Not possible through the link | Better fit |
| Visitors who prefer their own inbox | Good fit | Some people find forms impersonal |
| Tracking which page produced a message | Possible with a labelled subject | Built in |
Mailto links, scrapers and spam
An address published in a mailto link is readable by anyone who opens the page, and that includes automated harvesters that scan websites for email addresses. This is the same reason an email extractor can find addresses in a page or a file. If an address is in the HTML, it can be collected.
Common workarounds include writing the address with words such as at and dot, assembling the link with JavaScript after the page loads, or showing an image of the address. Each of these reduces casual scraping, but each also makes life harder for real visitors, screen reader users and anyone copying the address. They are also far from perfect, because many harvesters now run JavaScript.
For most businesses the better approach is to accept that a public contact address will receive some unsolicited mail, publish a role address such as support@ or hello@ rather than a personal one, and rely on good spam filtering at the mail server. Keep personal addresses off public pages, and keep the public address easy for genuine visitors to use.
Testing before you publish
A mailto link takes a few seconds to test, and testing is the only way to know how it behaves for real people. Clients differ in small ways, especially in how they treat line breaks, plus signs and very long bodies, so a link that looks perfect in one app can arrive slightly wrong in another.
- Click the link in at least one desktop browser and confirm which mail app opens.
- Check that the To, cc and bcc lines contain exactly the addresses you expect, with no stray spaces.
- Read the subject and body as the visitor will see them, and look for leftover codes such as %20 or a literal plus sign.
- Repeat the test on a phone, because mobile mail apps often handle long bodies and line breaks differently.
- Send the test message and confirm it reaches every inbox listed in the link.
- Keep a copy of the working link in your documentation so the next person who edits the page does not rebuild it from memory.
When you change a page template, check the email links again. Template edits, copy-and-paste between editors and automatic link formatting are common ways for a working mailto link to lose its encoding.
Common mistakes
- Typing spaces directly into the subject or body instead of encoding them as %20.
- Using a second question mark instead of an ampersand to add the next field.
- Leaving an unencoded ampersand or hash sign in the body, which cuts the text short.
- Writing a long, formatted email template into the body and expecting it to keep its layout.
- Using a plus sign for spaces and assuming every client will convert it.
- Separating several recipients with semicolons and assuming every client accepts them.
- Publishing a link to an inbox that nobody monitors, or to a personal address that will attract spam.
- Hiding the address entirely behind link text, so people without a mail app have no way to copy it.
Almost all of these come from writing links by hand and not testing them. Building the link with an encoder, reading the output once and clicking it on two devices catches nearly every one.
