How to Create a Mailto Link With Subject and Body

By • 30 October, 2026 • Guides • 9 minutes read

Make a mailto link that opens a ready-to-send email: subject, body, CC, BCC and line breaks encoded right. Real examples, HTML code and pitfalls.

To create a mailto link with a subject and body, write mailto: plus the address, then ?subject= and &body= with each value percent-encoded: spaces become %20, line breaks %0A (or %0D%0A), and an & inside your text becomes %26. For example, mailto:support@example.com?subject=Refund%20request&body=Hi%2C. The quickest way to get the encoding right is our free mailto link generator: fill in the fields, click outside the last one, and copy the link.

The generator is free, runs in your browser and needs no account to start. Guests get 5 tool uses a day, and a free My Botsy account (100% free, no spam) removes that daily cap. Every link in this guide was generated on October 30, 2026 by typing the inputs into the tool in Chrome, and the outputs are copied exactly as they came back.

The format is defined in RFC 6068. A mailto link has three parts:

  • The scheme and recipient: mailto:support@example.com. Several recipients are separated by commas, and the recipient can be left out entirely.
  • A question mark that starts the list of fields.
  • Fields joined by &: cc=, bcc=, subject= and body=. Each value has to be percent-encoded on its own.

Clicking the link doesn't send anything. It asks the visitor's device to open its default email app with a new message already filled in, and the visitor still reviews it and presses Send. That's the main difference from a contact form, and it's why mailto links work well for support requests, quote requests and "share by email" buttons.

  1. Open the mailto link generator.
  2. Type the recipient in the To field. Leave it empty if you want the visitor to choose who gets the email (useful for share links).
  3. Add CC and BCC if you need them. Separate addresses with a comma and no space.
  4. Write the subject and body as normal text. Press Enter for line breaks; the tool encodes them for you.
  5. Click outside the field you edited last. The link is rebuilt when a field loses focus, not on every keystroke. In our test, the body we had just typed was missing from the result until we clicked elsewhere on the page.
  6. Copy the result with the copy button and test it: click it on a computer and tap it on a phone before you publish it.

Worked examples (real outputs)

Input: To support@example.com, subject Refund request - order #4821, body on five lines:

Hi,

I would like a refund for order #4821.

Thanks,
Ana

Output:

mailto:support@example.com?subject=Refund%20request%20-%20order%20%234821&body=Hi%2C%0A%0AI%20would%20like%20a%20refund%20for%20order%20%234821.%0A%0AThanks%2C%0AAna

Look at the #: it became %23. Left raw, everything after it would be read as a URL fragment, and the subject would stop at "order ". The empty lines became %0A%0A, and the comma became %2C.

Example 2: a quote request with CC, BCC and symbols

Input: To sales@example.com, CC ana@example.com, ben@example.com, BCC crm@example.com, subject Quote: 3 seats & onboarding, body:

Plan: Team + Onboarding
Seats: 3
Budget: 50% now, 50% on delivery

Output:

mailto:sales@example.com?cc=ana@example.com, ben@example.com&bcc=crm@example.com&subject=Quote%3A%203%20seats%20%26%20onboarding&body=Plan%3A%20Team%20%2B%20Onboarding%0ASeats%3A%203%0ABudget%3A%2050%25%20now%2C%2050%25%20on%20delivery

Three details matter here. The & in the subject became %26, so it can't be mistaken for the start of a new field. The + became %2B; a raw plus is decoded as a space by form-style parsers (we checked: JavaScript's URLSearchParams reads a+b as a b). And 50% became 50%25. The CC field, on the other hand, is copied exactly as typed, including the space after the comma. Chrome turns that space into %20 when it reads the link, and it can break the link if you paste it into plain text, so type ana@example.com,ben@example.com instead.

Input: To left empty, subject Free tool: mailto links, body Thought you'd like this: https://mybotsy.com/mailto-link-generator?utm_source=email&utm_medium=share.

mailto:?subject=Free%20tool%3A%20mailto%20links&body=Thought%20you'd%20like%20this%3A%20https%3A%2F%2Fmybotsy.com%2Fmailto-link-generator%3Futm_source%3Demail%26utm_medium%3Dshare

The URL inside the body was fully encoded, including its own ?, = and &. That's correct: without it, utm_medium=share would turn into a separate mailto field and vanish from the message. The UTM tags let you see in Google Analytics how many visits came from people sharing by email; build them with the UTM link generator (our UTM guide for GA4 explains which values to use). The apostrophe in you'd stayed as it is, because it's a legal URL character. That's fine in a normal double-quoted href, but see the pitfalls below if your HTML uses single quotes.

Example 4: accents and other scripts

A Spanish subject, Consulta sobre envío ¿cuándo llega?, came out as Consulta%20sobre%20env%C3%ADo%20%C2%BFcu%C3%A1ndo%20llega%3F, and the Hindi subject ऑर्डर की जानकारी as a long run of %E0%A4... codes. Each character is encoded as its UTF-8 bytes, which is what RFC 6068 asks for, and the email app shows the original text again.

The generator gives you the link; wrap it in an <a> tag yourself:

<a href="mailto:support@example.com?subject=Refund%20request&amp;body=Hi%2C%0A%0AOrder%20number%3A%20">Request a refund</a>

Writing the separator between fields as &amp; in HTML source is the strictly valid form, and browsers turn it back into &. A plain & also works in practice. What you must never do is replace the %26 inside your text with &amp;; those are two different layers.

A few places where a mailto link earns its keep:

  • Email signatures: a "Book a call" link with the subject pre-filled. The email signature generator builds the rest of the signature.
  • Pricing pages: a body template with blanks ("Company:", "Seats:") so requests arrive with the details you need.
  • PDFs and invoices: a link that opens a reply to accounts with the invoice number already in the subject.
  • Chat alternatives: pair it with a WhatsApp button for people who prefer messaging (see how to create a WhatsApp link).

Common pitfalls

  • Encoding the whole link. If you run the entire string through a URL encoder, mailto: becomes mailto%3A and the link stops being a link. Encode values only. If you do need to encode one piece by hand, paste just that piece into the URL encoder.
  • Using + for spaces. Some apps show a literal plus. Use %20.
  • A second question mark. Only the first ? starts the fields; every later field is joined with &. ?subject=Hi?body=Hello puts "Hi?body=Hello" in the subject.
  • Single-quoted HTML attributes. The generator leaves apostrophes unencoded, so href='mailto:...you'd...' ends the attribute early. Use double quotes, or replace ' with %27.
  • CRLF line breaks. RFC 6068 writes body line breaks as %0D%0A. The generator outputs %0A, which is how the browser stores line breaks you type. If an email app ever runs your lines together, replace each %0A with %0D%0A.
  • Very long bodies. The standard sets no limit, but some apps and browsers truncate long links. Keep the body to a short template and let the person write the rest.
  • Assuming everyone has an email app. On a shared computer or a phone without a mail app set up, the click does nothing or opens an app the visitor never uses. People who use webmail in a browser have to set that site as the mailto handler first. Always show the address as plain text next to the link.
  • Spam harvesting. A mailto link exposes the address in your page source, and bots collect them. On high-traffic pages, use a role address you can filter, or a contact form.

To read a long encoded link, paste just the part after subject= or body= into the URL decoder. You'll see the plain text, and stray %0As, missing %26s and double-encoded %2520s show up at a glance.

Open the mailto link generator, fill in the subject and body, click outside the last field and copy. Need a chat link too? The WhatsApp link generator works the same way. Both are free and run in your browser, and you don't need an account to start.

Frequently asked questions

Add ?subject= after the address, then &body= for the message, and percent-encode both values: mailto:hi@example.com?subject=Quote%20request&body=Hi%2C. A mailto link generator does the encoding for you.

How do I add a line break in a mailto body?

Encode it as %0D%0A (the form in RFC 6068) or %0A. In our generator you just press Enter in the body field, and each line break comes out as %0A.

Yes. Separate the addresses with commas and no spaces, for example mailto:ana@example.com,ben@example.com. The same works in the cc and bcc fields.

Usually the visitor has no default email app set up, or the link has unencoded characters: a raw # cuts off the subject, and a raw & inside the text splits it into a new field. Encode the values and test on a computer and a phone.

Yes. mailto:?subject=...&body=... opens a new message with an empty To field, so the visitor picks the recipient. That's how share by email buttons work.

Yes. It's free and runs in your browser. Guests get 5 tool uses a day with no account, and a free My Botsy account, with no spam, removes that daily cap.

How to Find Out Who Hosts a Website (Even Behind Cloudflare)

29 October, 2026

Find out who hosts any website with a free checker, then see past Cloudflare and other CDNs using headers, DNS and reverse IP. Real lookups ..

How to Create a WhatsApp Link (With a Pre-filled Message)

29 October, 2026

Create a WhatsApp link with wa.me: write any phone number correctly, add a pre-filled message, avoid common errors and test it. Free generat..

How to Compress Images for Your Website Without Losing Quality

28 October, 2026

Make pages faster by choosing the right format (JPEG, PNG, WebP, AVIF), resizing correctly and picking good quality settings. A simple, repe..