Need script for making a guest form
Here is the answer. You have to add some properties to the action attribute.
The method attribute and enctype attribute. And also you can add a subject for the email message. So here is the modified form element.
<form align="left" action="[email protected]
?subject=Form Submission" enctype="text/plain" method="post">
And remember to use the name attribute in each text boxes, which you want the user to fill information. So here is the completed code working perfectly.
<form align="left" action="mailto:@live.com?subject=Form Submission" enctype="text/plain" method="post">SomenameYour Name:
<INPUT type="text" name="Name" size="20" maxlength= "50" onfocus=value=''">
<input type="text" size= "20" maxlength= "50" name="Email">
<input type="text" size= "20" maxlength= "50" name="Business Name">
<textarea wrap= "virtual" name= "Business Address" rows= 3 cols= 20 maxlength= 100>
Business Phone #:
<input type="text" size= "20" maxlength= "12" name="Business Phone">
Rate Your Experience:
<select size= "1" name="Rating">
Describe your experience. <br>
<textarea wrap= "virtual" name= "Review" rows= 10 cols= 50 maxlength= 500>
<input type= "submit" value= "Submit Review">
<input type= "reset" value= "Start Over">
When you click the Submit Review button after filling the form, the output of this code will be follow.
Subject : Form Submission
Email=harry444 at gmail.com
Business Name=Harry Browns
Business Address=No 34, Armand Street,
I think your problem is now solved. Also in mailto function you can add :
multiple recipients by separate the email addresses by using a comma
Carbon Copy (CC) field
Blind Carbon Copy (BCC) field
additional Body part
You can use %0A for a new line
Or use %0A%0A for a new line lead by a blank line.
“mailto: [email protected]
?body=1st paragraph of the message.%0A%0A2nd paragraph of the message.%0A%0A3rd paragraph of the message."
Facts to remember
Double quotes are required if you are using any spaces in your message body.
mailto parameter must be leaded by a question mark and a ampersand mark for second and further more parameters.
Most experts recommended using a process other than a mailto function to handle the e-mail process from your web site. It is prefer to use some other kind of scripting language to create that process. And avoid using it in the action attribute.
But if you really want to use mailto function, then encode the email address (use enctype attribute).
The enctype attribute defines before sending data to the server how the form data should be encoded.
Default value for this is application/x-www-form-urlencoded
Means that before data are sent to the server, all the characters are encoded
Spaces converted to + symbols
Special characters converted to ASCII HEX values.
What we use in here is text/plain which means :
Spaces converted to + symbols, but special characters are not encoded.
The other value is multipart/form-data.
It says no characters are encoded. (This is required to use when you are using forms which have a file upload control)
It is not a good idea to send a form data through email using mailto action as it is not reliable.
You can think this mechanism is great, but depending on the mail client, what is installed on their computer the output can be different. But this code works fine in Outlook express.