mailto.cgi v2.0 - README - 1998 04 19 Copyright 1997 by Scott Wimer http://www.cgibuilder.com/ -blurb- This is an Perl script for mailing the contents of Web Forms. It includes HTML callable input checking routines that allow the web author to require the submitted data meet certain requirements - all through hidden form elements. -about- mailto.cgi is a Perl script for parsing web based forms. All configuration for the script is taken from the form input. This makes it highly portable and extremely useful for applications that would otherwise require multiple scripts. The fundamental power of mailto.cgi is that it lets each form specify error-checking routine calls from within the HTML and each form can completely control the format of the email message from directives in the HTML. This approach both reduces the total time required to create web based forms, but also reduces the likely hood of programming errors (instead of having to make several CGI scripts run perfectly, only one has to be made bug free). This translates directly into a savings of time and money (not to mention that the script it self is free). -installation- Installation of mailto.cgi requires copying 'mailto.cgi', 'Var_Sub.pm', and 'checks.pl' into your CGI directory. You will then need to set the executable bit on 'mailto.cgi'. The only change you may have to make is changing the path to Perl in the first line of 'mailto.cgi'. Standard settings for the permissions can be achieved with the following command: 'chmod 755 mailto.cgi'. -configuration / use- mailto.cgi has 5 types of configuration options. They are: mailer directives, info directives, email-formating directives, error-checking directives, and confirmation message directives. NOTE: All directives are CASE SENSITIVE. That means that "SUBJECT" and "Subject" are NOT the same. Once you have added the necessary configuration directives (between the opening
tag) build your web form just as you normally would. The format and a basic description for each type is displayed below: MAILER DIRECTIVES: The following directives control the mailer:(RECIPIENT, THANKURL, SUBJECT, FROMADDRESS). Only RECIPIENT is required. All others SHOULD be used, since otherwise the code uses internal defaults that may not be what you desire. The format for these directives is below: The FROMADDRESS directive will be processed specially if it contains a dollar sign('$'). You can refer to the contents of another field by setting the value of FROMADDRESS to be a dollar sign followed by the name of another field. Caveats on the format of the field names are discussed below in the section on email formatting directives. The following chart shows the type of data that must be used for each directive: DIRECTIVE DATA TYPE ------------ -------------- RECIPIENT email address THANKURL URL SUBJECT Text FROMADDRESS email address or $field_name INFO DIRECTIVES: The following directive controls whether or not to send additional information regarding the browser used when the form was submitted:(BROWSER_INFO). The format for this directive is below: This directive behaves like an advanced on/off switch. If the directive is not present, then the information about the visitors browser and IP address information (basically, the environment variables available to the mailto.cgi script) will not be sent. If you simply specify the BROWSER_INFO directive without any variable names, then all the information about the visitors browser will be sent. You can choose which values you wish to get in the email by specifying them as a comma separated list in the value portion of the BROWSER_INFO directive. The example below will only report the name of the remote host, and the official browser type they are using: EMAIL-FORMATTING DIRECTIVES: The following directives control the formating of the email message generated: (SEPARATOR, ALPHA_SORT, SUPPRESS_EMPTY, FORMAT). The SEPARATOR directive is used to define the Text which separates the Field Name from the Field Value in the generated email message. The format for this directive is below: Where the value is a Text string to use as the new separator. If this directive is not defined in the form, then the script defaults to ": " as the delimiter. Output using the default would appear as: Field_Name: Data from form The ALPHA_SORT directive controls the order of the Fields in the generated email message. The format for this directive is below: If this directive is not used, the Fields will be in the order in which they appear in the HTML of the Form. If this directive is used, the sorting will be done alpha-numerically. The SUPPRESS_EMPTY directive causes Advanced Form Mailer to omit any empty Fields from the generated email message. The format for this directive is below: It also behaves as a switch. If you wish to receive all Fields including empty ones, do not use this directive. The FORMAT directive allows you to completely control the email. Using the FORMAT directive requires you to name your fields with only letters, numbers, and underscores in the name. Also, the first character in the field name must be a letter or an underscore. If your fields are named properly then you can use the FORMAT directive. The value for the FORMAT directive is the entire body of the email message you wish to send. The data from each of the fields in your form is available in the FORMAT as '$