Mailform CGI Program Read Me File This document provides an overview of the mailform cgi package. Also included are basic installation and configuration instructions. This document contains: Contents € Introduction € What the Mailform CGI program can do for you € Files transferred to your account € Using the Program and Setting Up the Variables in Your Forms € Variable Substitution Instructions € Performing a Test Using the Example Files € How the Whole Process Flows € Contacting SimpleNet for Help € Introduction Upon signing up for the mailform CGI access, you should have received an e-mail, telling you to look into your account for this file and read it carefully. Well, you are now in the right place to help you set up this service and use it to make your web pages more interactive. If you have not already read up on the advanced features of the HTML language, then you should probably do so, so the rest of this file will make more sense to you. I will only assume a few things when writing this. One, is that you are familiar with the basics of HTML, and two, you are at least starting to be familiar with the more advanced features, such as forms. € What the Mailform CGI program can do for you The mailform CGI program will allow you to accept information from a user that is browsing your web site. You may wish to have a questionnaire, a simple order form, a feedback form, or any other type of user input. Using the mailform program, you can set up these HTML pages to accept that input, and send that input to you in the form of an e-mail message. You can then give them back a custom message after they have submitted their information. It can be used with any forms that you create, each having their own preferences for the e-mail sent, and responses. For example, you may wish to send all of the feedback information to one e-mail address, while the ordering information you wish to be sent to another address. € Files transferred to your account When you signed up, and received a confirmation e-mail, we created a directory(folder) within your Documents directory called "mailform". In this directory, we put these files : ReadMe.txt (This file) exampleform.htm response.htm mailtemp.txt Here is a description of what these files are, and what they will do. ReadMe.txt - Obviously it is the file you are looking at right now, and should explain how to use the program. exampleform.htm - This is an example HTML form to test with. response.htm - This is the example response that the user gets back after submitting their information. mailtemp.txt - This is an example template that is used to send your e-mail information to you. It allows you to format the information however you would like to see it when it comes as an e-mail message. All of these files and their uses will be explained in the sections below. € Using the Program and Setting Up the Variables in Your Forms In order to use the mailform program, you will need to include the correct information within your html form. Since you are reading up on the form features on HTML, you should know that a form needs the
tag, and needs specific parameters within that tag to work. You must have these EXACT lines at the top of your form, after tag : The only things that you need to change about these lines are the values of each of the variables. The following is a description of each of the variables, and the values they can have. "email_form_to" - This is the e-mail address that you want the form information to be sent to after submission. You may enter more than one e-mail address here if you wish copies to be sent to more than one address. Simply separate the e-mail addresses using commas. Replace "cgi@simplenet.com" with your own e-mail address. "email_subject" - This variable is used to name the subject field of the e-mail that you receive. You can use variable substitution in this variable if you wish to include any information that the user has entered. Replace "Mailform Info" with the subject that you wish to see. "email_from" - This variable is used to give the from address, or name to the e-mail message that is sent to you. You may have this as anything you like, including any variables that the user already entered. Replace "cgi@simplenet.com" with your own e-mail address. "template_filename" - This is the name of the file that is to be used as a template for the e-mail that is sent to you from the form. It is simply a text file that the program uses, that will allow you to place headings and the entered information from your form in a format that you wish to view. This can be used to create text that can be input into a database, or just so you can make their entered information readable. See the following section for variable substitution instructions. "response_filename" - This is the name of an html file that you have in the same directory that will be shown after the person has submitted their information. This can also be a relative form location too. For example, if you have a file in a different directory, you can put the relative path name to that file. (i.e. "Responses/response.html") But it has to be relative from your form, or it will not find it. IMPORTANT : If you have any images on the response html page, then you need to make sure they are using the full path names instead of relative ones. See the following section for variable substitution instructions. After you have cut and pasted those lines into your form, you will also need a submit button somewhere within the form. It will look something like this, but it does not have to be exactly like this : If you have all of the above information in your html form, then try it out, and it should work ! € Variable Substitution Instructions You may use some of the information that the user has entered on your form within your e-mail subject, e-mail from area, and the response file that the person views after submission. In order to insert a piece of information that the user has supplied on your form, you can put the name of the variable preceded with the "&" symbol. For instance, if you want to include who the e-mail was from in the subject of the e-mail you receive, and you have an input variable on your form named "firstname", then you can insert the user entry in the subject by setting subject = Order from &firstname The "&firstname" will then be replaced with whatever the user entered in the "firstname" field that you created on your form. You can also do this with the "email_from" variable, as well as the response html page that the user views after submission. This is also the premise of the "mailtemp.txt" file. It is simply a text file with a format of your choice. You then include the variable names (preceded by the "&" character), and those variables will be replaced with the user entered information. If it does not find a "mailtemp.txt" file, then it will send you an alphabetized list of the variable names and their values. You can view the example file in the "mailform" directory that was given to you to see how this was done. € Performing a Test Using the Example Files Included in the directory that was transferred into your account were some test files that you can use to see how it is supposed to be set up. The first is the "exampleform.htm". This file is an example html file that has an example form for a user to fill out. If you look at it, you can see how the form must be called using the tag, and the hidden variables in order for it to work. Also included is an example response html form named "response.htm". This is the response given to the user after they have submitted the form. There is nothing fancy about the response file. It can be any kind of html file you wish. The only thing you need to make sure is that for any images on the form, that they are accessed using a full path name instead of a relative one. For example, if you want an image to appear, then you need to use a tag like this : instead of one like this : To test the program, you need to go through these steps : 1) Download and change the "exampleform.htm" variables and load it back into a different directory (you cannot load anything into the "mailform" directory). 2) View the example page with your browser. It should have the address : http://youraccount.com/mailform/exampleform.htm 3) Fill out the example form and use the submit button. 4) The sample response page should then come up. 5) Check the e-mail address that you entered in the form variable for a new message. You will notice that the e-mail message was sent to you, and it is formatted in the same way as the "mailtemp.txt" file is, except now the variables have been substituted. € How the Whole Process Flows So now, here's what happens when a user goes to your form. 1) The user reaches your form, and inputs all of the information into the fields and choice areas. 2) The user presses the Submit button. 3) The mailform program is called, and does these things : a) Checks to see if you have access to this service. b) Receives the entered information from the form. c) Looks for the "mailform.txt" file within the same directory that the form is in. d) If the file is not in the same directory, then it looks in your Documents directory. If it does not find it there, it gives an error response. e) If it finds one, then it read the file for the variables. f) Sends the e-mail message, and gives the html response. 4) The user then sees the response that you specified. 5) You receive the e-mail at the address you specified. € Contacting SimpleNet for Help Before you contact us with your questions, you might try this address to see if any of your questions are answered : http://www.simplenet.com/faq-mailform.html If you still have problems installing or using the mailform CGI program, please send e-mail to this address : cgi@simplenet.com Please provide your account name, and form locations, so we may be able to help you better. If you have any other questions, please go to this page to find out the e-mail addresses of the appropriate departments : http://www.simplenet.com/mail.html