mailto link for large bodies

后端 未结 2 1014
野性不改
野性不改 2020-12-18 22:15

I have a page upon which a user can choose up to many different paragraphs. When the link is clicked (or button), an email will open up and put all those paragraphs into th

相关标签:
2条回答
  • 2020-12-18 22:59

    Does the e-mail content need to be in the e-mail? Could you store the large content somewhere centrally (file-share/FTP site) then just send a link to the content?

    This makes the recipient have an extra step, but you have a consistent e-mail size, so won't run into reliability problems due to unexpectedly large or excessive content.

    0 讨论(0)
  • 2020-12-18 23:06

    By putting the data into a form, I was able to make the body around 1800 characters long before the form stopped working.

    The code looked like this:

    <form action="mailto:youremail@domain.com">
        <input type="hidden" name="Subject" value="Email subject">
        <input type="hidden" name="Body" value="Email body">
        <input type="submit">
    </form>
    

    Edit: The best way to send emails from a web application is of course to do just that, send it directly from the web application, instead of relying on the users mailprogram. As you've discovered, the protocol for sending information to that program is limited, but with a server-based solution you would of course not have those limitations.

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