HTML Mailto Link Generator
Build a mailto: link with To, CC, BCC, Subject, and Body pre-filled — copy the URI, anchor tag, or button.
mailto: URI
HTML anchor tag
Button with onclick
Preview
Email usHow mailto: links work
A mailto:link opens the visitor's default email client with the fields pre-populated. Special characters in the subject and body must be percent-encoded — this generator handles that automatically. You can specify multiple recipients by separating addresses with commas. Note that some webmail clients and spam filters may ignore BCC values embedded in mailto links.
For a contact form that sends email via SMTP without requiring a client app, pair this with a server-side form handler. To encode other data, see the URL Encoder.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Building a mailto link with a pre-filled subject and body.
- Producing a link that opens a support email with a template already in it.
- Getting the encoding right for a body containing line breaks.
- Adding CC or BCC recipients to a contact link.
- Producing the anchor markup rather than just the URI.
Frequently Asked Questions
- What can a mailto link pre-fill?
- Recipient, cc, bcc, subject and body, as query parameters after the address — `mailto:[email protected]?subject=Hi&body=Hello`. Everything after the first `?` is a normal query string, which is why each value has to be percent-encoded rather than pasted in raw.
- Why does a subject with an apostrophe break the button version?
- Because `encodeURIComponent` deliberately leaves `'` alone — it is an RFC 3986 sub-delimiter — and the button embeds the URL in a single-quoted JavaScript string, so "It's urgent" closed the string early. The button now percent-encodes it as `%27`, which decodes back to an apostrophe in the mail client.
- How long can the URL be?
- Shorter than you would like. Browsers and mail clients vary, and the practical safe ceiling for the whole mailto is around 2,000 characters — Outlook has historically truncated well before that. A long pre-filled body is the first thing to move into the page instead.
- How do I put line breaks in the body?
- Encode them as `%0D%0A` — a CRLF pair, which is what `encodeURIComponent` produces from `\r\n`. A bare `%0A` works in most clients and not all of them, which is a difference that only shows up on whichever client your least technical user has.
- Does publishing a mailto link attract spam?
- Yes — harvesters scrape `mailto:` from HTML and always have. A contact form or an address assembled by JavaScript reduces it, though neither is a real defence against a determined scraper. Weigh it against the fact that a mailto is the lowest-friction way for a genuine person to reach you.
Common errors and gotchas
- Not URL-encoding the subject and body, so an ampersand truncates everything after it.
- Using a literal newline rather than an encoded one, which most clients will not honour.
- Putting a very long body in the link, which some clients and browsers truncate.
- Exposing an address in plain markup, which harvesters read as easily as browsers do.
- Assuming a mail client is configured, since on many machines the link does nothing at all.
Related Web & SEO tools
Meta Tag Generator
Build SEO title, description, and viewport meta tags.
Open Graph Generator
Generate Open Graph and Twitter Card meta tags.
Robots.txt Generator
Build a robots.txt file with per-bot rules. Block AI crawlers, set crawl delays, define sitemaps.
UTM Campaign URL Builder
Append UTM parameters to build trackable campaign URLs.
Hreflang Tag Generator
Generate hreflang link tags for multilingual SEO.
Sitemap XML Generator
Build an XML sitemap from a list of URLs.
SERP Snippet Preview
Preview how your page title and meta description appear in Google search.
Meta Tag Analyzer
Paste a page's HTML head to audit its title, meta, and social tags.