How to use cgi email by kindson munonye

6
HOW TO USE CGIEMAIL By Kindson Munonye By Kindson Munonye The CGIEMAIL program allows account holders to set up feedback forms with the input from users being directed to the e-mail recipient of your choice, and formatted in any way you choose.

description

This is an explanation of CGI Email and how to include it in in your web application. Step by step guide

Transcript of How to use cgi email by kindson munonye

  • 1. HOW TO USE CGIEMAILBByy KKiinnddssoonn MMuunnoonnyyeeThe CGIEMAIL program allows account holders to set up feedback formswith the input from users being directed to the e-mail recipient of your choice,and formatted in any way you choose.

2. STEP 1: DESIGN THE FORMThe first part of using the program is to design your formtxtemailtxtfnametxtsurnametxtsextxtcommentNote: Take note of the names you give to the textboxes and listbox 3. STEP 2: CREATE THE TEMPLATEIf the form file 'feedback.html' you might call your second file 'feedback.txt'The name of the field to be substituted is placed in square brackets [ ]The first and second lines of the template to start with 'From:' and 'To:' respectively.Also, you MUST have the To: and the Subject: line followed bythe blank line.Those three lines MUST be on the FIRST THREE lines. Youcannot change the From: address.ExampleFrom: [txtemail]To: [email protected]: Testing CgiemailFirstName: [txtfname]Surname: [txtsurname]Sex: [txtsex]Comment: [txtcomment] 4. STEP 3: DETERMINE THE FORM ACTIONThe form action determines what will be done when the filled form is'submitted'.In the case of CGIEMAIL, the action is made up of two parts:the first part points to the location of CGIEMAILthe second part tells CGIEMAIL where to find the templatethe feedback.txt file is in your root directory 5. STEP 4: TEST THE FORM WITH CGIECHOBefore you actually start using your form you can test it with a program calledCGIECHO, CGIECHO works like CGIEMAIL except the it will display theresults or error in a web page.To test your form:In your html file (feedback.html) replace cgiemail with cgiechoOpen your page in a web browserEnter information in the fields and press the submit button. 6. STEP 5: SUCCESS AND FAILURE PAGEYou can send the recipient to a second page or URL after they submit the form.If you wanted to send the user to another page after they have successfullycompleted the submitted the form, you would use this field in your form:Or better yet, include this field to generate a redirect to a page of your own design: 7. STEP 5: SUCCESS AND FAILURE PAGEYou can send the recipient to a second page or URL after they submit the form.If you wanted to send the user to another page after they have successfullycompleted the submitted the form, you would use this field in your form:Or better yet, include this field to generate a redirect to a page of your own design: