在 GMAIL 中预填充大量正文文本时出现请求 URI 太长错误

发布于 2024-08-27 13:26:35 字数 817 浏览 7 评论 0原文

这是问题的后续问题。

我在构建 Google Apps 应用程序的地方 - 我可以使用以下网址从我的应用程序调用 Gmail 撰写消息页面:

https ://mail.google.com/a/domain/?view=cm&fs=1&tf=1&source=mailto&to=WHOEVER%40COMPANY.COM&su=SUBJECTHERE&cc=WHOEVER%40COMPANY.COM& bcc=WHOEVER%40COMPANY.COM&body=PREPOPULATEDBODY

但是,当我尝试在 body 参数中传递很长的一行文本(如回复消息正文)时,我从 Gmail 收到一条错误消息,指出请求 URI 太长。

有没有更好的方法来做到这一点,例如填写 gmail 撰写部分的文本正文框?或者以某种方式打开页面,并以某种方式预先填充 Javascript?

This is a followup of this question.

Where I was building a google apps application - I can call a gmail compose message page from my application using the url:

https://mail.google.com/a/domain/?view=cm&fs=1&tf=1&source=mailto&to=WHOEVER%40COMPANY.COM&su=SUBJECTHERE&cc=WHOEVER%40COMPANY.COM&bcc=WHOEVER%40COMPANY.COM&body=PREPOPULATEDBODY

However when I try to pass in the body parameter a very long line of text (like as a reply message body), I get an error from the Gmail stating that the REQUEST URI is too long.

Is there a better way to do this as in a way to fillin the text body box of gmail compose section? Or some way to open the page, and have it somehow prefilled with Javascript?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

心不设防 2024-09-03 13:26:35

我没有足够的业力来评论 Victor 的答案本身,但是不行,你不能 POST 到 Gmail 的撰写窗口。我自己尝试过,只是得到了常规的旧 Gmail 主屏幕,而不是撰写屏幕,当然也不是按照 OP 的要求填写了值的撰写屏幕。

这也太糟糕了,因为将大量信息放入 Gmail 撰写窗口是个好主意。 Gmail 团队中有人愿意解决这个问题吗?

I don't have enough karma to comment on Victor's answer itself, but no, you cannot POST to Gmail's compose window. I tried it myself and just got my regular old Gmail home screen, not the compose screen and certainly not the compose screen with the values filled in as the OP wanted.

It's too bad too, because it was a good idea to get loads of info into a Gmail compose window. Would anyone on the Gmail team care to address this issue?

暮年 2024-09-03 13:26:35

Google 不会处理长度超过 1584 个字符的 mailto 链接(在 mailto: 部分之后)。

Google will not process mailto links that are longer than 1584 characters (after the mailto: part).

睫毛上残留的泪 2024-09-03 13:26:35

这是大 URL 的问题 什么是不同浏览器中 URL 的最大长度?

使用方法 GET 可以使用

<form action="https://mail.google.com/a/domain/" method="get" target="_blank">
   <input type="hidden" name="view" value="cm">
   <input type="hidden" name="su" value="SUBJECT HERE">
   <input type="hidden" name="fs" value="1">
   <input type="hidden" name="tf" value="1">
   <input type="hidden" name="bcc" value="URL LIMIT EXCEEDED<Email list to large>">
   <input type="submit" value="Submit">
</form> 

该方法,使用方法 POST 则不起作用,它尝试但只是到达某个点并停止

<form action="https://mail.google.com/a/domain/" method="post" target="_blank">
   <input type="hidden" name="view" value="cm">
   <input type="hidden" name="su" value="SUBJECT HERE">
   <input type="hidden" name="fs" value="1">
   <input type="hidden" name="tf" value="1">
   <input type="hidden" name="bcc" value="URL LIMIT EXCEEDED<Email list to large>">
   <input type="submit" value="Submit">
</form> 

This is the problem with large URL's What is the maximum length of a URL in different browsers?

This works using Method GET

<form action="https://mail.google.com/a/domain/" method="get" target="_blank">
   <input type="hidden" name="view" value="cm">
   <input type="hidden" name="su" value="SUBJECT HERE">
   <input type="hidden" name="fs" value="1">
   <input type="hidden" name="tf" value="1">
   <input type="hidden" name="bcc" value="URL LIMIT EXCEEDED<Email list to large>">
   <input type="submit" value="Submit">
</form> 

This doesn't work using Method POST it tries but just gets to a point and stops

<form action="https://mail.google.com/a/domain/" method="post" target="_blank">
   <input type="hidden" name="view" value="cm">
   <input type="hidden" name="su" value="SUBJECT HERE">
   <input type="hidden" name="fs" value="1">
   <input type="hidden" name="tf" value="1">
   <input type="hidden" name="bcc" value="URL LIMIT EXCEEDED<Email list to large>">
   <input type="submit" value="Submit">
</form> 
江心雾 2024-09-03 13:26:35

为什么不使用一个带有隐藏字段的表单(方法 = post,目标 = 空白)来表示您需要发送的变量。然后发布该表格

Why not have a form (method = post, target = blank) with hidden fields that represent the variables you need to send. Then post that form

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文