mailto 不能处理大正文内容 [英] mailto not working with large body content

查看:40
本文介绍了mailto 不能处理大正文内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 mailto 函数在我的 Web 应用程序中获取 Outlook 窗口,使用以下代码.

I am trying to use mailto function for getting the outlook window in my web application, using the below code.

<a href="mailto:myemail@gmail.com?body=**bodyText**">发送邮件</a>

如果 bodyText 小于 1800 个字符,它就可以正常工作.但它会截断超过 1800 个字符的数据.如果正文内容超过 1800 个,则 Outlook 窗口只显示 1800 个字符并截断剩余的内容.

It works fine if the bodyText is less than around 1800 characters. But it truncates the data beyond 1800 characters. If the body content is more that 1800 outlook window just displays 1800 characters and truncate the remaining content.

推荐答案

首先我会参考 this 关于 URL 长度限制存在的原因.我已经尝试使用最新的 Firefox 和 Outlook 2010 进行快速测试

First I would refer to this as to why the URL length limit exists. I have tried a quick test using latest Firefox and Outlook 2010 using this

<html>
<body>
<form action="mailto:me@me.com">
<textarea name="body"></textarea>
<br/>
<input type="submit" />
</form>
</body>
</html>

在我的情况下,限制是 2061 个字符,但这将与电子邮件长度进行权衡.即使使用 POST 方法,结果对我来说也是一样的.

In my case the limit was 2061 characters, but that would be traded off against the email length. Even using POST method the result is the same for me.

由于所列原因,链接的问题(及其最佳答案)建议不要依赖截至 2016 年 4 月的长度超过 2000.

The linked question (and its top answer) advise not to rely on lengths longer than 2000 as of April 2016 for the reasons listed.

解决这个问题

我可以建议几个方向作为替代方案进行探索.

I can suggest a couple directions to explore as an alternative.

  1. 使用脚本调用 Outlook.我不喜欢它(兼容性、安全性),但这可能是 ActiveX 可能成为解决方案的一次.
  2. 如果目的是预览电子邮件、编辑和发送,您可以考虑编写应用程序从服务器端发送电子邮件的草稿副本.

就我个人而言,我会探索 #2 而不是 #1.在该解决方案中,用户将收到一封包含草稿消息的电子邮件,他们可以对其进行编辑和转发,或复制到新电子邮件中.这并不理想,但可能满足您的要求.

Personally I would explore #2 over #1. In that solution the user would receive an email containing the draft message, which they can edit and forward, or copy into a new email. It's not ideal but it might do for your requirements.

这篇关于mailto 不能处理大正文内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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