Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I 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.



And 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.


One 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: