Skip to main content

Creating mailto: links that actually work

· 3 min read

mailto: provides a way of creating hyperlinks in websites that will tell your computer to open the default mail client and create a new email without the user having to copy and paste the email address. You can even pre-fill the message subject and content.

A simple mailto: hyperlink looks something like this:

<a href="">Email me</a>

You can read the full RFC documentation here.

Pretty useful. And it seems simple at first. But differing implementations across email clients can make it a deceptively difficult to create a mailto: link that works everywhere.

You might have a link opening fine in Mail on a Mac, only to realise that the links no longer work for Outlook on a PC. And then you turn to Stack Overflow where you decide you should probably be using semi-colons, not commas, but no one can really agree. Then you promptly just give up.

Even the Wikipedia page for mailto: gives instructions that won't work by default on Outlook (which requires its users to actively turn on commas separation of email addresses).

Getting it right

Here is an example of a complex, robust, href link:

Try it out!

Notice, we're not using the actual characters for commas, semi-colons, whitespace, ampersands…


That mess just above is a bit hard to read(!), so let's break it down.



Sets the recipient(s) of the email. Separate multiple email addresses with %3B. This is the encoded character for a semi-colon.

There is also a 'to' header, which gives you an alternative way of setting email address to include in the to field of your email. Don't use it, Outlook seems to ignore it or treat it as a cc.


Headers allow you pre-fill other content of the email:

  • cc
  • bcc
  • subject
  • body


Email addresses to cc into the email. Separate multiple email addresses with %3B%20.


Email addresses to bcc into the email. Separate multiple email addresses with %3B%20.


Sets the subject field of the email. Replace whitespace with %20.


Sets the body of the email. Replace whitespace with %20.


Follow this example:
  • Separate email address with %3B%20
  • Separate headers with &amp;
  • Replace all spaces with %20
  • Do not use the to= header