ENCTYPE
With Mailto: Form Data
On this page I have included two forms exactly the same except that the first
form uses the default enctype for
emailed data (application/x-www-form-urlencoded). The second
example illustrates the attribute: ENCTYPE="text/plain"
Both examples are followed by llustrations of the resulting data
transmitted.
Finally the point of these examples is highlighted, and
information about testing your published web page form.

Example #1: Without the ENCTYPE
information:
Form submitted using the default ENCTYPE:
<FORM ACTION="mailto:hickslm@flint.umich.edu"
METHOD="post">
This is the response the I received as an email message.
Note, I have caused the textarea message to wrap around for better visibility and page
layout, but the string that arrived to me as an email, was one continuous line of text.
Date sent: Wed, 01 Jul 2000 20:18:53 -0400
From: Linda Hicks
To: hickslm@umich.edu
Subject: Form posted from Mozilla
MyTextArea=Hi+Linda+How+are+you+doing+to+day%3F++this+is+a+test+of+your
+input+form.%0D%0AI+hope+you+get+the+message.&contact=ON&My+Menu=Second
+Choice&comments=A.E.
+Neuman&response=on
|
When the attribute ENCTYPE="text/plain" is omitted,
the default MIME (translation type) is: application/x-www-form-urlencoded
Which means that the data will be converted as follows:
- A space is transmitted as a + sign.
- Each nonalphanumberic character is converted into a percent
sign followed by the two hex digits representing that character.
- An equals sign is placed between entry names and values.
- An ampersand is placed between entries.

Example #2: The correct technique, results when setting
ENCTYPE to text/plain: (This technique is now
supported by both the latest versions of Netscape and I.E.)
<FORM ACTION="mailto:hickslm@flint.umich.edu"
ENCTYPE="text/plain" METHOD="post">
Given the same input message, this is how the response looks now.
Date sent: Wed, 01 Jul 2000
20:19:55 -0400
From: Linda Hicks
To:
hickslm@umich.edu
Subject: Form posted from Mozilla
MyTextArea=Hi Linda How are you doing to day? this is a test of your input form.
I hope you get the message.
contact=ON
My Menu=Second Choice
comments=A.E. Neuman
response=on
|

The point
of this example is...
to convince you to always
use the tag: ENCTYPE="text/plain" when
you send form data via email.

Warning: Testing
your published web page form:
- If you try to test your email form from a home computer, your may be
prompted to set up your default email program by entereing: the POP3 incoming mail server
and SMTP outgoing mail server information. ITS has a quick notes on
this, QN29.pdf
)
- Transmitting form data via email from a campus computer lab:
While student computer labs are still set up with Pegasus Mail as the mail program,
you may encounter a problem transmitting form data using a web browser while on campus.
If you do not know if your form is working correctly, send me an email and
I'll test your form for you.

|