9

Update: Two years before this question, a similar question was asked: Effective maximum mailto: body lengths as pointed out by Peter O. Luckily answers of both questions are complementary :-) Browsers evolved a lot in the last two years, therefore we can say this question is an update of the other one ;-)


The specifications does not limit the mailto command length:

  1. RFC 6068 specification
  2. HTML 4 specification (mailto command is an URL)
    (please see this SO answer, the answers of this SO question and the comment of this one)

Therefore the mailto command length depends on internet browser implementations.

I guess very old browsers could not handle mailto commands using more than 255 characters well.

However, nowadays, memory size is no longer an issue about mailto command length.

What is the mailto max-length of the most common internet browsers?

Should be interesting to see whether browsers converge to the same mailto length limitation.

Community
  • 1
  • 1
oHo
  • 51,447
  • 27
  • 165
  • 200
  • possible duplicate of [Effective maximum mailto: body lengths](http://stackoverflow.com/questions/4473959/effective-maximum-mailto-body-lengths) – Peter O. Nov 29 '12 at 06:10
  • @PeterO. Yep, my question is a duplicate of [Effective maximum mailto: body lengths](http://stackoverflow.com/questions/4473959/effective-maximum-mailto-body-lengths) (I did not see it). However, the answers are complementary ;-). Let's say my question is two years update of the other question ;) Cheers – oHo Mar 19 '13 at 17:26

5 Answers5

9

Safari and most email clients have no hard limit (depends on available CPU and RAM)

2015 Web Browser Testing:

  • Safari
    • 705000000
    • 2 minutes
    • Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.1.56 (KHTML, like Gecko) Version/9.0 Safari/601.1.56
    • limited by 16GB RAM
  • Firefox
    • 268435455
    • 20 seconds
    • Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0
    • limited by maximum string length
  • Chrome
    • 2097132
    • 1 second
    • Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
    • limited without explanation
  • IE
    • 2029
    • 5 seconds
    • Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; rv:11.0) like Gecko
    • limited without explanation

2015 Email Client Testing:

  • Mozilla Thunderbird
    • 2097132 works in 1 second
    • 268435455 uses 100% CPU for 2 minutes but fails to render the body and is not usable
    • version 38.3.0
  • SeaMonkey
    • 2097132 works in 5 seconds
    • 268435455 uses 100% CPU for a long time (more than 5 minutes)
    • version 2.38
  • Apple Mail
    • 500000 works in 14 seconds
    • 2097132 uses 100% CPU for a long time (more than 5 minutes)
    • version 8.2
  • Microsoft Outlook
    • trims to 2070 in 1 second
    • version 2013

2017 update

Chrome 61 still works with 2097132 length on macOS (16 GB RAM);

navigator.userAgent;
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
location.href='mailto:?body='+'a'.repeat(2097132);

According to @Chloe on windows (32 GB RAM) it's limited to 1800;

"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
user1133275
  • 2,642
  • 27
  • 31
  • 1
    Where did you get these numbers? Chrome is nowhere near 2 million characters. I'm seeing a limit around 1800 before the link stops working. – Chloe Oct 09 '17 at 18:53
  • Oh, that's the difference. It's Windows. `"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"`. – Chloe Oct 10 '17 at 15:49
  • 32 gigabytes of RAM – Chloe Oct 10 '17 at 16:01
4

Just for reference I've found that google chrome's latest build (23.0.1271.95) only lets me generate a mailto with a maximum length of:

1910 characters

pleshy
  • 1,468
  • 2
  • 16
  • 22
2

Firefox does not impose any limits on the length of URLs other than the system's available memory, so you'll have to look into operating system limits for the maximum length of the parameters when invoking a process.

Additionally, you can set a Web app as your mailto URI scheme handler, and in that case the limit depends on the server accepting the request. Firefox comes with a few options like Gmail and Yahoo! Mail, and you can register your own handler with navigator.registerProtocolHandler. If you're curious, open about:config and filter on "gecko.handlerService.schemes" to see the Web app handlers you have configured in your browser.

I can't say for other browsers, but once you start to depend on so many different variables (browser, available memory, OS, server), it's probably best to try a different strategy.

Reuben Morais
  • 1,013
  • 1
  • 8
  • 20
  • +1 Thanks for this first answer. No limit on Firefox side: Firefox really respects the standards! I did not know that web app could as `mailto` client, I am curious how to do... Cheers ;-) – oHo Nov 20 '12 at 08:24
  • I've edited the answer with a few details about Web protocol handlers. – Reuben Morais Nov 20 '12 at 09:29
  • Thanks for your tips. I set GMail as my default e-mail client using these two links: http://googlesystem.blogspot.fr/2009/06/set-gmail-as-default-email-client-in.html http://ubuntuforums.org/showthread.php?t=1969207 – oHo Dec 31 '12 at 12:10
  • IE9 cannot send an email if `mailto` URL is only 715 characters, but contains 20 email addresses. It seems to be able to send to only up to 12 email addresses which is roughly 400 characters in my particular case. – ajeh Mar 05 '15 at 21:22
2

If I am using JavaScript function to build the mailto URL (with dynamic title and body) then calls window.open(url) to launch the default EMail client, the max length of this URL seems to be much shorter. EMail client won't be activated if the URL is too long.

Here is the max length that works for browsers running on Windows only.

  • 2042 characters on Chrome 64.0.3282.186
  • 2046 characters on Edge 16.16299
  • approximately 32700 characters on Firefox 58.0
Evan Zhang
  • 21
  • 1
1

Unfortunately browsers and various clients very loosely comply with RFC documents, but to answer your question you can have a look at this answer

Community
  • 1
  • 1
Reza S
  • 9,480
  • 3
  • 54
  • 84
  • Thank you Reza. I did not notice this SO question. I understand recent browsers accept very long `mailto` commands. Therefore, nowadays, the limitation is more on OpertingSystem and e-mail applications. Cheers – oHo Nov 26 '12 at 17:32