mailto not working with large body content

后端 未结 1 1910
独厮守ぢ
独厮守ぢ 2021-01-20 20:35

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

相关标签:
1条回答
  • 2021-01-20 21:32

    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>
    

    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.

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

    getting around this

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

    1. Using scripting to invoke Outlook. I don't like it (compatibility, safety) but this may be the one time ActiveX might be a solution.
    2. If the aim is to preview an email, edit, and send, you may consider writing the application to send a draft copy of the email from the server end.

    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.

    0 讨论(0)
提交回复
热议问题