Mailto link with subject and body
To add a subject to a mailto link, put ?subject= after the address and write the subject with spaces as %20: mailto:hello@example.com?subject=Booking%20request. Add a body with &body=, and write line breaks in it as %0D%0A. The generator on this page encodes all of it as you type.
Mailto link generatorUpdated 4 min read
The syntax
A mailto link is the address, then a question mark, then fields joined with &:
mailto:hello@example.com?subject=Booking%20request&body=Hi%2C%0D%0A%0D%0AA%20table%20for%202%2C%20please.
That link opens a new email to hello@example.com with the subject "Booking request" and a body of two paragraphs. The rules come from RFC 6068, the standard for mailto links:
- One question mark. It separates the address from the fields. Everything after it is a list of
name=valuepairs. &between fields.subject,body,ccandbcccan come in any order.- Spaces are
%20. The standard says not to use+for spaces, because a mail app can't tell it apart from a real plus sign. - Line breaks are
%0D%0A. That's the standard's rule for the body. Line breaks don't belong in the subject. - Reserved characters are encoded. A
&,?,#or%inside your text has to be written as%26,%3F,%23or%25, or the mail app reads it as part of the link.
Make yours
Type the address, subject and message below. You get the link, an HTML version to paste into a website, and a QR code that opens the same email on a phone.
Mailto link generator
Open the full toolCommon mistakes
A subject that stops early. "Q&A session" written as is becomes the subject "Q" and a broken field. Encoded, it's Q%26A%20session.
Line breaks that turn into odd characters. If you write \n or a bare %0A, some mail apps show it as text or ignore it. %0D%0A is what the standard asks for.
Two question marks. mailto:a@example.com?subject=Hi?body=Hello makes "Hi?body=Hello" the subject. Use & before every field after the first.
Spaces in the address. Addresses never contain spaces. If you're sending to several people, separate the addresses with commas.
Cc and bcc
Add other recipients with cc= and bcc=, separated by commas:
mailto:hello@example.com?cc=team@example.com&subject=Booking%20request
RFC 6068 has a warning for public pages: every address in the link can be read by anyone who looks at the page's code, bcc included. Spam bots collect addresses that way. Leave bcc out of links on a public website.
The standard also says a mail app only has to understand subject and body. Most apps handle cc and bcc too, but if a field matters, test the link in the apps your readers use.
In HTML
In a web page, the link goes in the href of an ordinary <a> tag:
<a href="mailto:hello@example.com?subject=Booking%20request">Book a table</a>
In HTML, the & between fields can also be written as &. Browsers read both. The HTML the tool gives you escapes it this way, so it's safe to paste into any page or template.
Keep the body short
A long, pre-written body is tempting, but mail apps and browsers have practical limits on link length. Our tool warns you past about 2,000 characters. A short body with a prompt, such as "Date and time:" on its own line, works better than a full letter, and leaves the person room to write.
Is a mailto link safe to click?
For the person clicking, yes. RFC 6068 says a mail app shouldn't send anything from a mailto link without showing the full message first and waiting for the user to send it. Nothing leaves their outbox until they press send, and they can change the subject and body first.
In a QR code
The same mailto link works as a QR code. ZXing's barcode guide recommends a full mailto: link rather than a bare address, so scanners know to start an email. The QR code under the tool uses the full link, subject and body included.
For the mailto and sms syntax side by side, see our post on mailto and SMS links. If your link opens the wrong app or nothing at all, read mailto link not working.
Sources
- RFC 6068: The 'mailto' URI Scheme (IETF), checked 2026-11
- Barcode Contents: E-mail address (ZXing wiki), checked 2026-11
Questions
How can I create a mailto hyperlink with a subject line?
Put ?subject= after the address, then the subject with spaces written as %20: <a href="mailto:hello@example.com?subject=Booking%20request">Email us</a>. The generator above writes and encodes it for you.
How do I add a subject to an email link?
Add ?subject=Your%20subject to the end of the mailto address. If the link already has a ? in it, join the subject with & instead.
How do I create a clickable mailto link?
Use an ordinary HTML link whose href starts with mailto:, such as <a href="mailto:hello@example.com">hello@example.com</a>. Copy the HTML version from the tool to get one with your subject and body filled in.
Will every mail app show my subject and body?
The standard says the subject and body are the two fields every mail app should understand. Other fields, such as cc and bcc, are more likely to be ignored by some apps.