3 ms·
Same. How would that work? What would be the end result (email body)?
by thih9 3y ago
Same. How would that work? What would be the end result (email body)?
- bdcravens 3y agoIt passes all form fields in URL encoded format in the body (example, name=Billy+Cravens&state=TX)
- GrantMoyer 3y agoLooks like it can also be plaintext encoded[1], so something like: name=Billy%20Cravens state=TX [1]: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#submit-mailto-body https://html.spec.whatwg.org/multipage/form-control-infrastr...
- codetrotter 3y agoSounds like a really bad UX I think if my mom was trying to submit a form, and it opened her email client with a body consisting of URL encoded data she’d probably just close the email client thinking that something went wrong. Then she’d try again and the same thing would happen again. Then she might call me, and I’d probably tell her to just forget about it and try to call them on the phone instead or give up and try another company instead.
- vaylian 3y ago> with a body consisting of URL encoded data The e-mail client decodes the URL encoded data. So you actually see plain text. The encoding is only done for the purpose of passing the data from the browser to the e-mail client.
- codetrotter 3y agoI created a form with a dropdown and a some other inputs. The result when using enctype=application/x-www-form-urlencoded and method=post in the form html is that the body that is shown in my email client is URL encoded. They have a different enc type that you could use to specifically make it plain text. That one is not recommended because then you're gonna have a bad time parsing out the fields that were submitted from the form.
- codetrotter 3y agoAnd for reference, here is what the mail body looks like with enctype=text/plain and method=post when it is opened in iCloud mail ready to send cat=services btext=adsfasdfsdafsdf afsdfas asd fa sdf as dfs subscribe-newsletter-weekly-yes=yes Other email clients might create different looking body for text/plain enc type.
- codetrotter 3y agoOne variant that seemed interesting was method=get with enctype=application/x-www-form-urlencoded In this case the values from the form get added as headers in the email so they are not directly visible to the user I thought that I could still add user-visible subject and body by adding ?subject=foo&body=bar to the mailto: url For example I could then have the subject say "Web form submission", and have the body of the mail contain a description that tells the user to send the email and that the data they filled into the form will be sent along with the email. Even that is not great UX imo, but could still be interesting. However from my testing with Brave web browser and Apple Mail, the subject and body are not filled in for the user in this case.
- throwup238 3y agoEmail body is in the “body” form field, subject line in “subject”, destination in “email”. https://www.w3docs.com/snippets/html/how-to-create-mailto-forms.html https://www.w3docs.com/snippets/html/how-to-create-mailto-fo...
- bdcravens 3y agoThose parameters need to be passed in the mailto: URL, not the form, if the FORM is a POST mailto:example@gmail.com?subject=About+your+extended+warranty
- ReleaseCandidat 3y agoYou see that in the "email" forms of for example most "contact" sites. Like, for example, here on HN, in the right end of the site's footer (on desktop), by clicking "Contact" (but this isn't a form, just a "mailto:..." link).