30

I would like to know how to include multiple email addresses in mailto link. I am trying this:

<a href="mailto:email@example.com?subject=[Help]%20Base Leisure&cc=email@example.com,email@example.com">Contact Email</a>

But it is not working. Any idea of how to do it?

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
pollux1er
  • 5,372
  • 5
  • 37
  • 36

4 Answers4

53

You need a semi-colon as the separator.

<a href="mailto:email@example.com?subject=[Help]%20Base Leisure&cc=email2@example.com;email3@example.com">Contact Email</a>

Some e-mail clients (e.g. Android's GMail) won't allow mailto: links to duplicate the same e-mail address in both To: and Cc: fields.

FJT
  • 1,923
  • 1
  • 15
  • 14
  • 4
    According to https://www.rfc-editor.org/rfc/rfc5322.txt as mentioned in https://stackoverflow.com/questions/9278363/emailing-to-multiple-recipients-with-html-mailto-not-working, the separator is a comma ",". Using a semicolon does not work for me (Firefox and Thunderbird). – Hermann Jun 18 '18 at 10:07
  • @Hermann The document referred talks about how to present the headers during communication, there's no mention about HTTP requests *mailto* structure. the proper document to refer to is https://tools.ietf.org/html/rfc6068#section-2 and you are correct. The standard proposes to be a comma-separated value for multiple addresses. See section 2. – raphie Sep 13 '19 at 22:33
  • 1
    @Hermann But a comma separated value is not accepted by Outlook ... [check this image](https://1drv.ms/u/s!AnEFOAQkEQmxuBlvaiQtj9bYflZn?e=mUBjWw) – raphie Sep 13 '19 at 22:58
9

Adding on to this now, as I've spent some time dealing with this issue. This is going to be mostly for desktop applications, and its absolutely not foolproof. Its just the most reasonable option.

Outlook for PC only accepts semicolons as a separator. Commas will break it. Some common mail applications in recent years accept both semicolon and comma. And everything except outlook accepts a comma. For example, Apple Mail does not accept semicolons, especially if you have more than 3 addresses separated, but Gmail has no issue.

Its a bad catch 22, the best solution seems to be to check the users platform via window.navigator.platform, and if you see Windows change the separator to a semi-colon. It's absolutely not a bullet proof solution, and you should avoid relying on a mailto link if you need this sort of functionality. But if it must be done, check the platform and hope for the best.

This solution is tested for these default applications, assuming the user is running recent operating systems:

Mac (comma): Outlook for Mac, Apple Mail, Gmail, browser Gmail

Windows (semicolon) : Outlook 2011 onward, Windows Mail, Gmail.

iOS (comma): iOS Mail, Gmail

douliman
  • 111
  • 2
  • 4
1

I came across a solution to this issue. To specify 2 or more postal addresses, the connecting characters "%2C%20" must be used between them. They are used instead of commas. On this resource, you can learn more about the parameters that can be used. It turns out that the link will be like this.

<a href="mailto:email@example.com?subject=[Help]%20Base Leisure&cc=email@example.com%2C%20email@example.com">Contact Email</a>
-2

    <a href="mailto:email@example.com?subject=[Help]%20Base Leisure&cc=email@example.com;email@example.com">Contact Email</a>
Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109