CookMail Tutorial


Basics

  1. In the HTML form, include the following in the form tag:
    	<FORM METHOD=POST ACTION=/cgi-bin/cookmail>
    
    where /cgi-bin/ is the directory name CookMail installed in. Note, the above works only if your CookMail program is on Unix. On NT/Windows 9x, you need to use:
    	<FORM METHOD=POST ACTION=/cgi-bin/cookmail.exe>
    
  2. You will also need to specify the email recepient in a input field named TO (case sensitive, all capitals):
    	<INPUT TYPE=HIDDEN NAME=TO VALUE="cookmail@ag.arizona.edu">
    
Now you are ready to include whatever input fields and CookMail will automatically format the HTML output and the email messages.

Examples:


Advanced Features

  1. To redirect the HTML output to another web page, use the following input filed:
    	<INPUT TYPE=HIDDEN NAME=REDIRECT VALUE="http://www.yahoo.com">
    
  2. To be able to go back to the page that spawned email form in the output, add the following after the form tag:
    	<!--#exec cgi="/cgi-bin/cookmail" -->
    
    *NOTE* Above will only work if your web server allows server-side execute. This is useful in determining where a visitor enter the form page from.
    The power of CookMail lies in the feature that HTML authors have the complete control over the format of the email message and output should be.

    To control the format of email messages, including the following tag within the form:

    	<INPUT TYPE=HIDDEN NAME=FORM VALUE=/complete-path/email.form>
    
    Similiarly, to control the output, include the following tag:
    	<INPUT TYPE=HIDDEN NAME=SHOW VALUE=/complete-path/email.show>
    
    The filenames don't have to be email.form and email.show. The format of SHOW and FORM files are the same as the normal HTML documents and email messages, respectively, except that cookmail recognizes ${field_name} and replaces them with corresponding field texts. For instance: ${TO} corresponds to the email address of the recipient. If there are quite a few field names and only some of them are included in the control files, the rest can be displayed using ${ETC}. ${ETC}, however, will not format the fields passed by httpd and the predefined input names.

    Note:

    Environmental variables passed to CGI scripts, such as HTTP_REFERER can also be recognized by cookmail. In this case, the format would be ${HTTP_REFERER}. Please consult www.w3.org for a complete list of available environmental variables to CGI scripts.

    Tip:

    You can create your SHOW files as an HTML file and then rename it to something else later. The name of the extension does not matter.
Examples: -> Use the Go Back link to come back to this page