mailto URL的最大实际长度是多少? [英] What is the maximum practical length of a mailto URL?

查看:224
本文介绍了mailto URL的最大实际长度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网页中,我向WCF服务发出Ajax请求.如果服务抛出错误,则将其传递回JSON.然后,JavaScript错误处理程序将显示一个隐藏的div,该div的mailto URL预先填充了我的详细信息,以便团队成员(这是一个小型内部应用程序)可以向我发送包括堆栈跟踪在内的错误.这是一个示例,它是通过测试运行得到的URL:

In my web page I make an Ajax request to a WCF service. If the service throws an error then that is passed back in the JSON. The JavaScript error handler then reveals a hidden div with a mailto URL prepopulated with my details so that team members (this is a small internal app) can send me the error including the stack trace. Here's an example resulting URL from a test run:

mailto:tttttttt@mmmmmmmmm.com?subject=potential%20seed%20save%20failed&body=Potential%20seed%20URL%20=%20unknown%0DResponse%20%3A%20%7B%22ExceptionDetail%22%3A%7B%22HelpLink%22%3Anull%2C%22InnerException%22%3Anull%2C%22Message%22%3A%22testing%22%2C%22StackTrace%22%3A%22%20%20%20at%20SavePotentialSeedSearches.WCFService.StorePotentialSeed(String%20url%2C%20String%20name)%20in%20C%3A%5C%5CTFS%5C%5CProjects%5C%5CSeeds%5C%5CPreliminaries%5C%5CSavePotentialSeedSearches%5C%5CWCFService.svc.cs%3Aline%2021%5Cu000d%5Cu000a%20%20%20at%20SyncInvokeStorePotentialSeed(Object%20%2C%20Object%5B%5D%20%2C%20Object%5B%5D%20)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object%20instance%2C%20Object%5B%5D%20inputs%2C%20Object%5B%5D%26%20outputs)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean%20isOperationContextSet)%22%2C%22Type%22%3A%22System.ArgumentException%22%7D%2C%22ExceptionType%22%3A%22System.ArgumentException%22%2C%22Message%22%3A%22testing%22%2C%22StackTrace%22%3A%22%20%20%20at%20SavePotentialSeedSearches.WCFService.StorePotentialSeed(String%20url%2C%20String%20name)%20in%20C%3A%5C%5CTFS%5C%5CProjects%5C%5CSeeds%5C%5CPreliminaries%5C%5CSavePotentialSeedSearches%5C%5CWCFService.svc.cs%3Aline%2021%5Cu000d%5Cu000a%20%20%20at%20SyncInvokeStorePotentialSeed(Object%20%2C%20Object%5B%5D%20%2C%20Object%5B%5D%20)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object%20instance%2C%20Object%5B%5D%20inputs%2C%20Object%5B%5D%26%20outputs)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc%26%20rpc)%5Cu000d%5Cu000a%20%20%20at%20System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean%20isOperationContextSet)%22%7D

长度为2354个字符.

That's 2354 characters long.

其他答案提示,超过2000个字符的URL是一个坏主意,因为某些浏览器可能会为此感到困扰.但是浏览器是否以任何方式解析mailto URL,还是将它们立即交给默认的邮件工具?如果将它们传递给他人,是否有人拥有各种邮件工具(尤其是Outlook)可以处理的mailto URL长度的数据?

Other answers suggest that URLs above 2000 characters are a bad idea as some browsers may struggle with them. But are mailto URLs parsed in any way by the browser or are they handed immediately on to the default mail tool? If they are handed on, does anyone have data on the length of mailto URLs that various mail tool (and in particular Outlook) can handle?

推荐答案

这里 -是的,浏览器将在发送之前解析URL -Safari和大多数电子邮件客户端没有硬性限制(取决于可用的CPU和RAM)

As noted here - yes the browser will parse the URL before sending it - Safari and most email clients have no hard limit (depends on available CPU and RAM)

2015 Web浏览器测试:

  • 野生动物园
    • 705000000
    • 2分钟
    • 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
    • 受16GB RAM限制
    • 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
      • 268435455
      • 20秒
      • Mozilla/5.0(Macintosh; Intel Mac OS X 10.10; rv:41.0)Gecko/20100101 Firefox/41.0
      • 受最大字符串长度限制
      • 2097132
      • 1秒
      • Mozilla/5.0(Macintosh; Intel Mac OS X 10_10_5)AppleWebKit/537.36(KHTML,例如Gecko)Chrome/45.0.2454.101 Safari/537.36
      • 没有解释的限制
      • 2029
      • 5秒
      • 像Gecko一样的Mozilla/5.0(Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; rv:11.0)
      • 没有解释的限制

      2015年电子邮件客户端测试:

      • Mozilla Thunderbird
        • 2097132在1秒钟内工作
        • 268435455使用100%CPU 2分钟,但无法渲染主体并且不可用
        • 版本38.3.0
        • 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
          • 2097132可在5秒内工作
          • 268435455长时间(超过5分钟)使用100%CPU
          • 版本2.38
          • 500000在14秒内工作
          • 2097132长时间(超过5分钟)使用100%CPU
          • 版本8.2
          • 在1秒内修剪到2070
          • 2013版

          这篇关于mailto URL的最大实际长度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆