13

Chrome's mailto length limit is around 2000 characters. It seems to be enough but in fact it's only enough for English Language. Because the length is calculated after encodeURI.

e.g. for only one Japanese character 'て'. encodeURI('て') gets "%E3%81%A6", which is 9 characters long. So I can only type in around 2000/9 = 200+ Japanese characters in my mail content. This is really too short.

So is there a way to get around this limit? Something like installing chrome plugin is acceptable.

Any suggestion is greatly appreciated.

EDIT

I have finally decided to use a server-side solution: Create a popup page to simulate mail client, with to, cc, subject, content and also a send button. After the user clicks the send button, the form will be submitted and server will send the mail for the user

wander
  • 927
  • 7
  • 15
  • 1
    You may have already read this but if your sending your own emails this my provide some useful info to ensure your emails don't end up in the spam folder - http://blog.codinghorror.com/so-youd-like-to-send-some-email-through-code/ if your serious about this then some SMTP cloud provider may be of use – SimonGates Jul 29 '14 at 21:18
  • 2
    Good point switching to a server-side solution. As a tip: Be sure to add spam protection by using captchas/rate-limits. Otherwise someone could use your server to send spam to other people and your SMTP server will be blacklisted by common mail providers. (Happend to me a few years ago). – Pascal Raszyk Jul 30 '14 at 09:11
  • Thanks for your advice. – wander Jul 31 '14 at 02:33

2 Answers2

4

I have no problem with any sized mailto-links on a Firefox (Developer Edition 39.0a2, Windows XP), however Internet Explorer 8 and Chrome do not work with mailto-links over the mentioned size of around 2000 characters. So, I doubt it is a Windows specific problem.

Willi Mentzel
  • 24,988
  • 16
  • 102
  • 110
Martin
  • 872
  • 1
  • 9
  • 25
3

this appears to be a microsoft windows issue. i have tried the following on and it works well with different browsers (safari, chrome 30 & 36, ...) on mac os x.

in windows the request will get truncated to around 2000 characters. this will happen regardless of which browser is being used. it seems windows has a size limit on system uri requests.

i have tried from html <a href="mailto:?body=... and javascript document.location = encodeURI('mailto:?body=' + text) with 100k characters in the message body.

i have put both examples in this FIDDLE

dreamlab
  • 3,356
  • 19
  • 23
  • 1
    So it seems not to be chrome's fault. But chrome's encoding strategy for mailto url is really too bad for this OS limit. IE can support roughly 2000/2 = 1000 non-ASCII character while chrome can only support roughly 2000/9 = 200+. – wander Aug 19 '14 at 09:14