Add a question to the FAQ
Questions
What order are the Fields emailed in?
How do I change the order?
Can I use a different separator between Field names and values in the email?
Can I have the Form sent to more than one recipient
How do I make sure that Field X is filled out?
What kind of error checking is available?
Why doesn't the redirect work?
Can I specify more than one Field per CHECK directive?
Can I call the script via GET?
Why do I get 'Internal Server Errro ...'?
It says it can't find sendmail, what should I do?
What use is the SELECT CHECK?
What Directives does the script use?
What happens if I use a directive name as the name of a Field?
Answers
What order are the Fields emailed in?
By default, the Fields are printed in the email in the same order you defined them in the HTML. If you wish to change the order of the fields, see the next question in the FAQ.

How do I change the order?
The email output can be ordered via two different means. The first is to put the Fields in the same order that they occurred in the Form. The second allows you to sort the Fields alpha-numerically and have them be emailed in the sorted order. Sorting is turned off by default, and requires the use of an EMAIL-FORMATTING DIRECTIVE to turn on sorting. Copy and paste the line below into your Form and it will turn on alpha-numeric sorting:

<INPUT TYPE="HIDDEN" NAME="ALPHA_SORT" VALUE="">

Then you can prefix Field names with '1-', '2-', 'a-', 'b-' or some other such convention to control the order of the generated email.

Can I use a different separator between Field names and values in the email?
Yes. The default separator is ': '. Through the use of an EMAIL-FORMATTING DIRECTIVE you can use a different separator in the email. Copy and paste the line below into your Form and it will change the separator to ' = ':

<INPUT TYPE="HIDDEN" NAME="SEPARATOR" VALUE=" = ">

The value in the VALUE field is used as the separator in the email generated by your Form.

Can I have the Form sent to more than one recipient
Yes. The RECIPIENT MAILER DIRECTIVE takes a list of email addresses as its value. The line below will sets the RECIPIENT to be both scottw@cgibuilder.com and support@cgibuilder.com:

<INPUT TYPE="HIDDEN" NAME="RECIPIENT" VALUE="scottw@cgibuilder.com, support@cgibuilder.com">

How do I make sure that Field X is filled out?
The ERROR-CHECKING DIRECTIVE 'NOTBLANK' is used to ensure that a particular Field has data in it before Form submission is allowed. The example below shows how to make sure that the Field named 'First_Name' is not blank:

<INPUT TYPE="HIDDEN" NAME="CHECK:NOTBLANK:First_Name">

What kind of error checking is available?
The following ERROR-CHECKING DIRECTIVES are supported by Advanced Form Mailer v1.5:

EMAIL, PHONE, ZIP, NONUM, NOLETTER, NUMONLY, LETTERONLY, NOTBLANK, ZIP, SELECT

The HTML below demonstrates a use of each. Both the word 'CHECK' and the check type must be capitalized. While the checks are not totally self explanatory, they are very, very close(I think):
<INPUT TYPE="HIDDEN" NAME="CHECK:EMAIL:Email_Address">
<INPUT TYPE="HIDDEN" NAME="CHECK:PHONE:Phone_Number">
<INPUT TYPE="HIDDEN" NAME="CHECK:ZIP:ZIP_code">
<INPUT TYPE="HIDDEN" NAME="CHECK:NONUM:Name">
<INPUT TYPE="HIDDEN" NAME="CHECK:NOLETTER:Age_Range">
<INPUT TYPE="HIDDEN" NAME="CHECK:NUMONLY:Favorite_Number">
<INPUT TYPE="HIDDEN" NAME="CHECK:LETTERONLY:State">
<INPUT TYPE="HIDDEN" NAME="CHECK:NOTBLANK:Email_Address,Name">
<INPUT TYPE="HIDDEN" NAME="CHECK:SELECT:Product" Value="Select a Product">

Explanation of ERROR-CHECKING DIRECTIVES
How the check rules are applied. . .
Each Field to be checked is passed to a function in the Advanced Form Mailer script corresponding to the type of check chosen. If the Field is blank, the check passes. Wait, don't start, yelling at me yet, it does that for a reason! If the Field is not blank, it verifies that the Field meets whatever rules that function. This method applies to all rules except to NOTBLANK and the SELECT ERROR CHECKING DIRECTIVES, for obvious reasons.
This allows you to have Fields that are optional, but, if filled out, force the user to input correct data. This is a good thing! :)
<INPUT TYPE="HIDDEN" NAME="CHECK:EMAIL:Email_Address">
The "CHECK:EMAIL:Field Name" directive verifies that the contents of the Field 'Email_Address'looks a valid email address. Due to the nature of email no mechanism exists to make sure the email address given really is valid, but this will tend to eliminate the biggest percentage of junk data.
<INPUT TYPE="HIDDEN" NAME="CHECK:PHONE:Phone_Number">
The "CHECK:PHONE:Field Name" directive verifies that the contents of the Field 'Phone_Number' appears to be a valid US telephone number. The program's current idea of what constitutes a valid US telephone number is: [3 digit area code] [3 digit prefix] [4 digit number] [optional 2-6 digit extension].
I've tried to make this check as forgiving as possible, while still ensuring that the data it lets through comes really close to looking like a valid US phone number
<INPUT TYPE="HIDDEN" NAME="CHECK:ZIP:ZIP_code">
The "CHECK:ZIP:Field Name" directive verifies that the contents of the Field 'ZIP_code' appears to be a valid ZIP Code. Advanced Form Mailer understands simple 5 digit ZIP Codes as well as the increasingly common ZIP plus 4 format.
<INPUT TYPE="HIDDEN" NAME="CHECK:NONUM:Name">
The "CHECK:NONUM:Field Name" directive verifies that the contents of the Field 'Name' has no numbers in it. If the contents of the Field does contain numbers, then the user will be prompted to change their input.
<INPUT TYPE="HIDDEN" NAME="CHECK:NOLETTER:Age_Range">
The "CHECK:NOLETTER:Field Name" directive verifies that the contents of the Field 'Age_Range' does not contain any letters. All other characters are allowed, but not letters.
<INPUT TYPE="HIDDEN" NAME="CHECK:NUMONLY:Fav_Number">
The "CHECK:NUMONLY:Field Name" directive verifies that the contents of the Field 'Fav_Number' is all numbers.
<INPUT TYPE="HIDDEN" NAME="CHECK:LETTERONLY:State">
The "CHECK:LETTERONLY:Field Name" directive verifies that the contents of the Field 'State' contains only letters.
<INPUT TYPE="HIDDEN" NAME="CHECK:NOTBLANK:Email_Address,Name">
The "CHECK:NOTBLANKField Name" directive verifies that the Field are not blank. This directive is most often combined with one other ERROR-CHECKING DIRECTIVE to force the user to both input data, and make sure that the data is useable to you.
<INPUT TYPE="HIDDEN" NAME="CHECK:SELECT:Product" VALUE="Select a Product">
The "CHECK:SELECT:Field Name" directive verifies that the value chosen from the select list is NOT the value you specified in the VALUE="..." section of the directive. This is the only directive that does not work with multiple Form fields.

Why doesn't the redirect work?
The 'THANKURL' directive sends the users browser to your thank you page. Some web servers require that this URL be a fully qualified URL, or at least be a fully qualified path. This means that './my_thank_you_page.html' will only work if your server does not have this more or less braindead limitation. Notably, if you are on a Netscape server, relative URLs will not work for the 'THANKURL' directive, you must specify a fully qualified URL.

Can I specify more than one Field per CHECK directive?
Yes. On all but the 'SELECT' directive, you can specify a list of comma separated field names, in the 'CHECK:TYPE:...' hidden field.

Can I call the script via GET?
No. The Advanced Form Mailer only supports POST requests. This is probably a good thing all things considered. GET requests can be truncated (since they are passed as an environment variable to the back end CGI script). Since data from a POST method submission is passed on STDIN (STanDard INput) which has no such potential limitation.

Why do I get 'Internal Server Errro ...'?
Typically, this error is presented because the script tried to execute a program and failed. With the Advanced Form Mailer, the program it tries to execute is sendmail(1). Some web servers just kill the CGI script when it tries to execute a non executable program. I know for a fact that Apache 1.2b6 (which is my development server currently) does.

It says it can't find sendmail, what should I do?
Advanced Form Mailer uses sendmail(1) to send the mail to the address(es) listed in the 'RECIPIENT' Field. Every time it starts up, it looks in 3 or 4 standard places for the sendmail(1) program. If it can't find it, it dies giving you this error message.

What use is the SELECT CHECK?
The 'SELECT' check type allows you to require the user to choose a value from your select list. Typically you would set the value of this to be the string you made the first line of your select list. This way, if the user doesn't choose a different option from your select list, the Form will tell them that they need to.

What Directives does the script use?
Advanced Form Mailer makes use of 4 types of directives: mailer directives, info directives, email formatting directives, and error checking directives. All directives are case sensitive, and are ALLCAPS (the EarthLink specific version of Advanced Form Mailer allows certain mixed case mailer directives for compatibility reasons). MAILER DIRECTIVES

<INPUT TYPE=HIDDEN NAME="RECIPIENT" VALUE="...">
This directive specifies the recipient email address for the Form data. The value must be a valid email address. No error checking is done against the value you specify (the script protects you from bad data from your users, not from you). :)
The value can be a list of comma separated email addresses.
This directive is not optional.
<INPUT TYPE=HIDDEN NAME="THANKURL" VALUE="...">
This directive specifies the URL to redirect the client's browser to if they correctly filled out the Form.
This must begin with either a ('/' or with 'http://....). This directive is not optional.
<INPUT TYPE=HIDDEN NAME="SUBJECT" VALUE="...">
This directive specifies the subject of the email generated from the contents of your Form. If unspecified, this defaults to 'MAILTO.CGI FORM DATA' in the current version of the script. This is an optional directive.
<INPUT TYPE=HIDDEN NAME="FROMADDRESS" VALUE="...">
This directive specifies the email address the Form generated email should appear to come from. This can be useful for advanced applications of this script. This also allows you to easily filter mail that came from your online Form. This is an optional directive.

INFO DIRECTIVES
<input type=hidden name="BROWSER_INFO" value="">
This value acts like a switch. If specified, information about the user's web browser is attached to the bottom of the email message generated from the Form data. If not, well, it doesn't. This is an optional directive.

EMAIL FORMATTING DIRECTIVES
<INPUT TYPE=HIDDEN NAME="SEPARATOR" VALUE="...">
This directive specifies the separator string between the Field name and the Field data in the generated email message. This is an optional directive.
<INPUT TYPE=HIDDEN NAME="ALPHA_SORT" VALUE="">
This directive behaves like a switch. If it is not specified, the Fields in the email message will be in the same order as they were in the HTML. If you use this directive to turn ALPHA_SORT on, the Fields will be sorted alpha-numerically. This is an optional directive.
ERROR-CHECKING DIRECTIVES
These directives are all explained individually in the FAQ. For that reason they are only listed here. All these directives are optional.
<INPUT TYPE=HIDDEN NAME="CHECK:NOTBLANK:Field_name">
<INPUT TYPE=HIDDEN NAME="CHECK:EMAIL:Field_name">
<INPUT TYPE=HIDDEN NAME="CHECK:NUMONLY:Field_name">
<INPUT TYPE=HIDDEN NAME="CHECK:LETTERONLY:Field_name">
<INPUT TYPE=HIDDEN NAME="CHECK:NONUM:Field_name">
<INPUT TYPE=HIDDEN NAME="CHECK:NOLETTER:Field_name">
<INPUT TYPE=HIDDEN NAME="CHECK:ZIP:Field_name">
<INPUT TYPE=HIDDEN NAME="CHECK:PHONE:Field_name">
<INPUT TYPE=HIDDEN NAME="CHECK:NOTBLANK:Field_name">
<INPUT TYPE=HIDDEN NAME="CHECK:SELECT:Field_name" VALUE="...">

What happens if I use a directive name as the name of a Field?
The short story is that you shouldn't, since this is likely to cause Advanced Form Mailer to behave in a way unfamiliar to you.
That being said, this allows you to use Advanced Form Mailer as an even more powerful Form handling tool. It lets the user of your Form control the way the script behind the Form behaves. In SOME environments that is a very good thing. Usually though, that isn't what you want to let happen.

FAQ Form Since This is a brand new script archive, there are few frequently asked questions. Use the form below to ask me a question. As I answer the incoming questions, I will continue to formulate the FAQ.
Your name
Your email address
Question
Your Pleasure