Prefilling large volumes of body text in GMAIL compose getting a Request URI too long error

筅森魡賤 提交于 2019-12-01 05:37:24

问题


Hi guys this is a followup from the question:

Prefilling gmail compose screen with HTML text

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 eg as a reply message body I get this error from GMAIL stating 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 prefilled with javascript some how...


回答1:


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?




回答2:


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




回答3:


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&lt;Email list to large&gt;">
   <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&lt;Email list to large&gt;">
   <input type="submit" value="Submit">
</form> 



回答4:


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



来源:https://stackoverflow.com/questions/2590467/prefilling-large-volumes-of-body-text-in-gmail-compose-getting-a-request-uri-too

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!