Toolstia / Mailto link generator
Mailto link generator
A mailto link is an ordinary web link whose address starts with mailto: instead of https:. When someone clicks it, their device opens the email program or web mail it uses by default, with the recipient, subject and message already filled in. It is the quickest way to put a contact link on a page without building a form or a server.
The catch is the encoding. Subjects and messages containing spaces, ampersands, question marks, percent signs, accents or line breaks cannot be written into the link as they are, and a single stray character can cut the message short or break the link. This generator fills in the pieces in a form and builds a correctly encoded link for you, along with a ready-to-paste HTML anchor tag.
Everything is assembled in your browser. Nothing you type is uploaded, and the Test the link button simply hands the finished link to your own email program.
How it works
- Enter the recipient, and optionally Cc, Bcc, subject and message.
- Add link text if you want something other than the address.
- Copy the link or the HTML. Use Test the link to try it.
Encoding
Characters such as spaces, & and ? would break a link, so they are encoded. Line breaks in the message become %0D%0A, which email programs understand.
Several recipients
Enter more than one address separated by commas, semicolons or spaces. They are joined with commas.
Limits
Very long messages may be cut off by some browsers and email programs. Keep the prefilled text short.
Spam
Writing an address on a public page lets bots collect it. A contact form is safer if spam is a worry.
A worked example
Suppose the recipient is [email protected], the Cc is [email protected] and [email protected] separated by a semicolon, the subject is Quote request & pricing, and the message is two lines: Hi, then I would like a quote for 50% off? Thanks. The tool produces this link:
mailto:[email protected][email protected],[email protected]&subject=Quote%20request%20%26%20pricing&body=Hi%2C%0D%0AI%20would%20like%20a%20quote%20for%2050%25%20off%3F%20Thanks
Spaces became %20, the ampersand became %26, the comma became %2C, the percent sign became %25, the question mark became %3F, and the line break became %0D%0A. The two Cc addresses were joined with a comma. The HTML version writes the link into an anchor tag and turns each & into & so the markup stays valid.
How the encoding works
The subject and the message are run through standard URL encoding, which turns every character outside a small safe set into a percent sign and the hexadecimal value of its UTF-8 bytes. An accented letter or a symbol takes more than one byte, so a coffee-cup symbol in a subject becomes %E2%98%95 and the e with an acute accent becomes %C3%A9. A space is written as %20, not as a plus sign, which is what mail programs expect in a mailto link.
Line breaks in the message are converted to %0D%0A, a carriage return plus a line feed. This is the line ending that email uses, as the mailto standard (RFC 6068) describes, so your paragraphs arrive on separate lines. Recipient addresses are left readable, with the @ sign kept as it is.
Several recipients, Cc and Bcc
In any of the To, Cc and Bcc fields you can type several addresses separated by commas, semicolons, spaces or new lines. The tool splits them and rejoins them with commas, which is the form mail programs understand. The To field is required: with it empty, no link is produced, so a link that only pre-fills a subject needs at least one address.
Cc and Bcc are added as parameters after a question mark, joined to each other with ampersands. Remember that Bcc in a mailto link is only a suggestion to the visitor's email program. The visitor sees the prefilled fields before sending and can change them, and the address in the link source is visible to anyone who views the page.
Link text and the HTML output
The link text box sets the words people see, such as Email us. If you leave it blank, the anchor shows the text you typed in the To field. The HTML output is a single anchor tag, ready to paste into a page or a content management system. Characters like the ampersand are escaped in the attribute and the link text, so the markup does not break.
If your editor offers an Insert link option, you can instead copy the plain mailto link and paste it as the address.
Limits and things that go wrong
There is no single length limit that every browser and mail program obeys, and very long prefilled messages are sometimes cut off or refused, so keep the prefilled text short, a few sentences at most. The message is plain text only: bold, links and images in the body are not supported, and attachments cannot be added through a mailto link.
A mailto link only works if the visitor has a default email program or a web mail handler registered. On a computer with neither, clicking it may do nothing. Some visitors also prefer to copy your address, so show it as visible text somewhere on the page. And an address written in plain view on a public page can be picked up by automated harvesters, so if spam is a concern, a contact form is the safer choice.
Questions
Does it work without an email program?
A mailto link needs a program or web mail set up as the default on the visitor's device.
Can I add an attachment?
No. Mailto links cannot attach files.
Is anything uploaded?
No. Your details stays in your browser and is never sent anywhere.
Why does my subject show %20 or odd characters when I click the link?
Most often the link was passed through another tool that encoded it a second time, or the mail program is not decoding it. Copy the link straight from this generator and avoid editing it by hand.
Can I leave the To field empty and only fill the subject?
Not in this tool. It needs at least one recipient before it builds a link. Add a placeholder address you will replace if the link is meant for a template.
Will the message body keep my paragraphs?
Yes. Each line break is written as %0D%0A, which email programs read as a new line. Blank lines between paragraphs are kept.
Can I use a mailto link in a button or an image?
Yes. Any element that can be wrapped in an anchor tag can use the link as its href. Paste the link into the button's or image's link field instead of using the generated anchor text.