Mailto Link Generator
Create a mailto link with the subject and message body pre-filled, correctly URL-encoded so it works across every mail client.
How to use it
- Fill in the fields — the code and the preview update as you type.
- Copy the generated HTML straight into your page.
- The preview renders the real markup, so what you see is what you get.
Examples
| hello@example.com, subject “Enquiry” | mailto:hello@example.com?subject=Enquiry |
A mailto link opens the visitor's default mail client with a new message already addressed, rather than sending anything itself — nothing is transmitted until they actually press send. The address goes after mailto:, and the subject and body are added as URL query parameters.
This generator handles the part that trips people up doing it by hand: subject and body text has to be URL-encoded, because spaces and punctuation are not legal characters in a URL. Type a subject with spaces and punctuation and the generator turns it into the correctly percent-encoded query string automatically, so the mail client decodes it back to normal text.
Pre-filling subject and body
A pre-filled subject is genuinely useful on a support or contact page — “Website enquiry” arriving in the subject line means it can be filtered or prioritised before anyone opens it. A pre-filled body works the same way for a short template, though most people delete boilerplate body text rather than fill in around it, so keep it short if you use it at all.
The spam problem, and the alternative
A visible mailto address is a magnet for email-harvesting bots that scrape web pages for exactly this pattern. Every mailto link you publish is a small ongoing tax in spam.
A contact form avoids the problem entirely, since no address appears in the page source at all. If a direct link is genuinely necessary, obfuscating the address with JavaScript, or presenting it as an image, makes it harder for the simplest scrapers, though neither is bulletproof against a determined one.
Questions people ask
Why do my spaces turn into %20?
URL encoding. Spaces and punctuation are not legal in a URL, so they are percent-encoded. Mail clients decode them again on the way in.
Will putting my email in a mailto attract spam?
Yes, harvesters scrape mailto links. A contact form avoids it, or obfuscate the address with JavaScript if you must use a direct link.
Is anything uploaded?
No. Everything runs in your browser — no file, image or snippet you use here ever leaves your device.
Last updated 22 August 2026