Free mailto link generator
Make an email link that opens a new message with the addresses, subject and message already filled in. Every character is encoded the way the mailto standard asks, so spaces, line breaks, plus signs and accented letters arrive as you typed them. Copy the link as HTML, a button that works in emails, a WordPress Buttons block or a shortcode that hides your address from simple spam bots.
- Correct RFC 6068 encoding
- HTML, button and WordPress block
- Phone and SMS links too
Free, no sign-up. Everything stays in your browser.
Nothing you enter leaves your browser.
This tool runs in your browser and needs JavaScript. Turn JavaScript on and reload the page.
Mailto link generator
Preview and code
The link
HTML link
Button HTML for pages and emails
Inline styles only, so it works in an email signature or newsletter as well as on a page.
WordPress Buttons block
Paste it into the block editor, or into the Code editor (Options, then Code editor). The block keeps the address readable in the page’s HTML; use the shortcode to hide it.
WordPress shortcode with antispambot()
Paste it into your child theme's functions.php or a code snippets plugin, then put the shortcode in any post, page or Shortcode block.
Markdown link
Spam protection, honestly
An email address on a public page will be found by spam bots sooner or later. These options make it harder for the simplest ones, and none of them stops all harvesters.
HTML character references
Each character of the link is written as a code, such as @ for @. Browsers turn the codes back into the address, so the link works as normal. Bots that read the page's raw HTML see only codes, but many harvesters decode them, so this helps a little at best.
WordPress antispambot()
WordPress's own antispambot() function swaps random characters of the address for codes each time the page is made, so the address looks different on every visit. The shortcode above uses it. It beats simple pattern matching, not a bot that reads the page the way a browser does.
WordPress developer reference: antispambot() (opens in a new tab)
A contact form instead
A contact form keeps your address off the page completely, and works for visitors who have no email app set up. With a form plugin, add spam protection such as a CAPTCHA or a honeypot field. Many sites offer both: a form, and a mailto link for people who prefer their own email.
This generator does not write JavaScript that puts the address together in the browser. Such snippets are usually inline scripts, which a strict Content Security Policy blocks, and bots that run JavaScript read the finished address anyway.
How a mailto link is written
The rules are in RFC 6068. The addresses come straight after mailto:, separated by commas. The other fields follow a ?, joined with &. Characters that have a meaning in a link are written as a % and two hex digits.
| You type | In the link | Why |
|---|---|---|
| A space | %20 | Never a +, which some apps would keep as a plus sign. |
| A line break in the message | %0D%0A | The line break email uses, as RFC 6068 requires. |
+ | %2B | So no app reads it as a space, in name+tag@example.com too. |
& ? # = ; | %26 %3F %23 %3D %3B | They separate the parts of a link. |
% | %25 | It starts every code. |
| é, ü, 漢字 and emoji | %C3%A9 and so on | UTF-8 bytes, each written as a code. |
| An international domain | xn-- form | The form every email app understands. |
Email apps decide for themselves what to do with a link. RFC 6068 only expects them to understand the subject and the message, so test Cc and Bcc in the apps your visitors use. Very long links can be cut off, and an app may add a line break at the end of the message. Sources: RFC 6068, The 'mailto' URI Scheme (opens in a new tab).
Preview and code
The link
HTML link
Button HTML for pages and emails
Inline styles only, so it works in an email signature as well as on a page.
WordPress Buttons block
Paste it into the block editor, or into the Code editor (Options, then Code editor).
How a phone link works
A tel: link opens the phone app on a phone, ready to call. On a computer it opens an app that can make calls, if one is set up, or does nothing. The rules are in RFC 3966: the number in full international form, a + then the country code and the number without its leading 0, written with digits only, and ;ext= for an extension.
| Number at home | Link |
|---|---|
| UK: 020 7946 0000 | tel:+442079460000 |
| Australia: (02) 9876 5432 | tel:+61298765432 |
| US: (201) 555-0123, ext. 45 | tel:+12015550123;ext=45 |
| Italy: 06 1234 5678 | tel:+390612345678 (Italian numbers keep the 0) |
An international number has at most 15 digits, country code included (ITU-T E.164). Show the number in the link text too, so people on a computer can read it and dial it themselves. Source: RFC 3966, The tel URI for Telephone Numbers (opens in a new tab).
Preview and code
The link
HTML link
Button HTML for pages and emails
Inline styles only, so it works in an email as well as on a page.
WordPress Buttons block
Paste it into the block editor, or into the Code editor (Options, then Code editor).
Will the message be filled in?
An sms: link opens the messages app with the number filled in. The standard, RFC 5724, writes the message after ?body=, with several numbers separated by commas, and that is what this generator writes. Whether the message appears is up to the phone:
- Apple's reference for
sms:links describes only the number, and says the link must not include message text. It is in Apple's documentation archive, which is no longer updated, and Apple publishes nothing newer about these links. - Google does not document
sms:links from web pages for Android. - So test the link on an iPhone and an Android phone. Apple documents links with just the number, so that is the part to rely on.
You may see links written sms:number&body= or sms:number;body= for older iPhones. No standard defines those forms, so this generator does not write them. On a computer, an sms: link only does something if an app there handles text messages. Sources: RFC 5724, The sms URI scheme (opens in a new tab) and Apple URL Scheme Reference: SMS links (opens in a new tab).
The length counter follows the GSM rules phones use: 160 characters fit one text, or 70 when the message has an emoji or a character outside the GSM alphabet, and longer messages are sent in parts. The phone that sends it has the final say.
What you get
-
To, Cc and Bcc with several addresses, each one checked
-
Subject and a message with line breaks, encoded to RFC 6068
-
A live preview and a button that opens your own email app
-
HTML link with title, class and an aria-label suggestion
-
A button with inline styles for pages and emails, in your colours
-
A WordPress Buttons block, an antispambot() shortcode and Markdown
How to make a mailto link
-
Enter the addresses and the email
Type the address the email goes to, and any Cc or Bcc addresses, separated by commas. Add a subject and the text the message should start with, if you want them.
-
Choose how the link looks
Set the link text, and the colours and corners of the button. Fix anything the checks point out, such as a misspelt address.
-
Test it and copy the code
Press Open in my email app to try the link, then copy the HTML, the button, the WordPress block, the shortcode or the Markdown into your site.
What a mailto link does
A mailto link is a link that starts with mailto: instead of https://. Clicking it opens the visitor's email app with a new message to your address. The link can also fill in the subject, the start of the message and Cc and Bcc addresses, so people get in touch with the details you need.
Why the encoding matters
Characters such as spaces, line breaks, &, ?, # and + have a meaning inside a link. Written as they are, they cut the subject short, drop the rest of the message, or turn a plus sign into a space. RFC 6068, the mailto standard, says which characters must be written as a % and two hex digits, and that line breaks in the message are written %0D%0A. This generator follows it exactly, including for accented letters, other alphabets and emoji.
A mailto link needs an email app
The link opens whatever email app the visitor's device uses for email links. Someone who only uses webmail, and has not set their browser to open email links there, may see nothing happen, or an app they never use. Show the address in the link text, or offer a contact form as well, so nobody is stuck.
Frequently asked questions
What is a mailto link?
A link that opens a new email instead of a web page. It starts with mailto: and the address, such as mailto:hello@example.com, and can also fill in the subject, the message and Cc and Bcc addresses.
How do I make a mailto link with a subject and body?
Put them after the address, behind a question mark and joined with &: mailto:hello@example.com?subject=Website%20enquiry&body=Hi%20there. A space is written %20 and a line break %0D%0A, as the mailto standard (RFC 6068) asks, and a plus sign must be %2B or some email apps show it as a space. Type the subject and message into the generator and it encodes them for you.
Why does nothing happen when I click a mailto link?
The device has no email app set up to open email links. Choose a default email app in the computer's or phone's settings. If you use webmail, such as Gmail or Outlook on the web, you can usually set your browser to open email links there.
How do I add line breaks to the message?
Just type them in the message box. The generator writes each line break as %0D%0A, the form the mailto standard requires, so the email app starts a new line there.
Can a mailto link add Cc and Bcc addresses?
Yes. Add them in the Cc and Bcc fields, separated by commas. Bcc addresses are hidden from the other recipients, but anyone can read them in your page's source code, and some email apps ignore them.
Will spam bots find my email address?
Any address on a public page can be found sooner or later. Writing it as HTML character references, or with WordPress's antispambot() function, stops the simplest bots only. A contact form keeps the address off the page altogether, and many sites offer a form and a mailto link side by side.
How do I add a mailto link in WordPress?
In the block editor, select some text, press the link button and type the full link starting with mailto:. For a button, copy the WordPress Buttons block from this tool and paste it into the editor. To hide the address from simple bots, add the shortcode to your child theme and type the shortcode where the link should go.
How long can a mailto link be?
There is no limit in the standard, but some email apps and browsers cut off or refuse very long links, and they do not publish their limits. The generator warns you above 2,000 characters. Keep the message short; the person can add more before sending.
Is anything I type sent anywhere?
No. The links and code are made in your browser, and nothing you type is sent to this site or anywhere else. To count how the tool is used, this site is told only that a link was made or copied, never what it contains.
Related tools
-
Email signature generator
New (added recently)Make an HTML email signature that works in Outlook, Gmail and Apple Mail, with a desktop, mobile and dark mode preview.
-
Email DNS
New (added recently)Build and test MX, SPF, DKIM, DMARC, MTA-STS and BIMI records, with the exact values for Google Workspace, Microsoft 365 and over 25 email services.
-
Social share preview
New (added recently)See how a link to your page will look on Facebook, X, LinkedIn, Slack, Discord, WhatsApp and Messages, check each tag and image, and generate the tags.
-
Colour contrast checker
New (added recently)Check the contrast of text and background colours against WCAG 2.2 AA and AAA, with suggested passing colours and a palette checker.