开发者

Effective maximum mailto: body lengths

There is a maximum length for the text in the &body section of a mailto: link. According to one of my co-workers, the W3C publish the limit as 256 (I don't have a link to back this up, t开发者_StackOverflow社区hough).

We're embedding mailto: links in both an e-mail and a webpage and have successfully used more than 256 characters. After a certain point, though, e-mail clients and browsers start flaking out and refusing to open the link.

I would like to know the actual maximum lengths allowed for the following:

Mail clients:

  • Outlook (2003, 2007, 2010)
  • Eudora (7.1, and/or whatever the latest version is)
  • Thunderbird (latest version)

Browsers:

  • Firefox (3+)
  • IE (6, 7, 8)
  • iPhone browser

Any and all numbers you can provide will be gratefully received.


The standard doesn't define a maximum length, leaving implementation up to browsers and mail clients (See IETF RFC 2368).

Microsoft products do have set limits:

  • IE GET limit is 2,083 http://support.microsoft.com/kb/208427
  • Outlook express: 456 characters http://support.microsoft.com/kb/q182985/

Other browsers are likely to work up to lengths beyond that of a reasonable email body. The iPhone doesn't have a documented limit, but works with up to 1MB of text.

Modern browsers that support data urls (everything except IE<9) should be fine.


For browsers with JS consoles, an easy test:

for (var i=2014; i>1600; i--) {var good=1; try {location.href='mailto:?body='+'a'.repeat(i)} catch (e) {good=0;} if (good==1) {console.log(i+13);break;}}

(The 13 is for the length of mailto:?body=.)

On Firefox 32.0.3 this produces 2008 (body length 1995). On Thunderbird 31.2.0, all 1,995 characters make it into the body of the new e-mail.

Some say it's mainly OS-setting-dependent but on Windows, at least, I couldn't find any registry entry related to mailto with a number near 2,000.


As of 2022 it seems outlook (2007 anyway) accepts long query_string of at least 8000 characters using mailto in Firefox. However using Google Chrome browser, Chrome failed right around 2000. Lowest common denominator seems to be Chrome. Too bad since this has been a request for over a decade.


I just did an experiment from Wolfram Mathematica to Microsoft Outlook. It works for string lengths of 31888 or less. This is the code I used for this experiment:

Table[ToString@RandomInteger[{0, 9}], 31433] //
     Partition[#, UpTo[80]] & //
    Map[StringJoin] //
   StringRiffle[#, "\n"] & //
  "mailto:xxxxxxx.xxxxxxx@xx.com?subject=Testing out mailto!&body="<> # & //
 Echo[#, "Total String Length", StringLength] & //
SystemOpen

and prints 31888 as the total string length. If you increase the 31433 by one, it stops working.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜