Skip to main content
wp-config.org

Search tools

Email

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

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.

How characters are written in a mailto link
You typeIn the linkWhy
A space%20Never a +, which some apps would keep as a plus sign.
A line break in the message%0D%0AThe line break email uses, as RFC 6068 requires.
+%2BSo no app reads it as a space, in name+tag@example.com too.
& ? # = ;%26 %3F %23 %3D %3BThey separate the parts of a link.
%%25It starts every code.
é, ü, 漢字 and emoji%C3%A9 and so onUTF-8 bytes, each written as a code.
An international domainxn-- formThe 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).

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

  1. 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.

  2. 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.

  3. 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.