mailto无法处理大量内容 [英] mailto not working with large body content

查看:103
本文介绍了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**">Send mail</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.

推荐答案

首先,我会参考

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. 如果目标是预览电子邮件,编辑和发送,则可以考虑编写应用程序以从服务器端发送电子邮件的草稿副本.

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

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天全站免登陆