| The form to email process we support on WebSTAR servers is based on the Lasso system.
The "FORM" tag for your form should use the following attributes:
<form action="Action.Lasso" method="POST">
The Action.Lasso call for sending email has 6 required form fields:
- "-email.from" - This can be a field for the visitor's email address or you can set one.
- "-email.to" - this is the address that the email should be sent to. Must be to "someone@yourdomain.com";
- "-email.host" - This is the Web Server that will process and send the mail. Use: "www.yourdomain.com"
- "-email.subject" - subject of the message. Something like: "web feedback form"
- "-email.format" - the name of the format text merge file that specifies what the body of the email will look like.
- "-response" - the URL of the page that the visitor should be redirected to after processing.
The input type of most of these fields should be "hidden" instead of "text".
Most of the time that would be the "-email.host", "-email.format", "-email.to", "-email.subject" and "-response" fields.
You can also use "-email.CC", and "-email.BCC" fields for other types of recipients.
When a user clicks on the submit button for the form, the server will pick up the value you specified in the "-email.format" field and look for a simple text file with that name in same folder. The name of ths "format" file is important It must have a ".lasso" extension.(E.g. emailform.lasso) The content of the format, when processed, will become the body of the email message that is sent. A "merge" type operation occurs with this file to replace the tags with data from your submitted form.
The format file for the form below (emailform.lasso) looks like:
Name: [form_param:'name']
Email: [form_param:'-email.from']
Subject: [form_param:'-email.subject']
Favorite iMac Color: [form_param:'FavColor']
Comments: [form_param:'comments']
Usage Tips:
- You might be tempted to setup a user enterable text field for the "-email.from" variable. The drawback to this is that if the user enters in an invalid address, the email may not be sent because mail servers could reject a message where the FROM address is not valid. (Garbage In/Garbage Out). To avoid this, make the "-email.from" a hidden input field with a hard coded email address like "webform@yourdomain.com". If you want to capture an email address from the user, then make a separate field for that data with a name like "email".
- To make a field required, place a hidden input tag directly before that field with the format:
<input type="hidden" name="-Required">
<input type="text" name="YourFieldName" size="30">
Example form:
|