|
||||
|
||||
| You Are Here: | Home > Internet & Web > Web Publishing > Webmaster's Toolkit > Web Form Mailer > Quick Start: Web Form Mailer |
|---|
Quick Start: Web Form MailerThe Web Form Mailer works by taking structured input from a web form and processing it to create an e-mail message that is sent to a specified e-mail address. Parameters for the mailer are set by using hidden form fields. Sample FormThis is a sample form that could be used to collect information from prospective students for the university. You could simply cut-and-paste this HTML code, change the e-mail address, save it, and put it online to have a fully-functioning e-mail form. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <title>Survey</title> </head> <body> <h1>Survey</h1> <form method="post" action="http://www.vt.edu/cgi-bin/disgroup/generic-mailer.pl"> <!-- Required Fields --> <input type="hidden" name="email" value="jane.doe@vt.edu"> <input type="hidden" name="from" value="john.doe@vt.edu"> <input type="hidden" name="replyto" value="john.doe@vt.edu"> <input type="hidden" name="format" value="text"> <input type="hidden" name="redirect" value="http://www.vt.edu/"> <!-- Optional Fields --> <input type="hidden" name="subject" value="Student Survey"> <p><b>Student's Major:</b> <input name="00major" type="text" size="30"></p> <p> <b>Gender:</b><br> <input name="01gender" type="radio" value="male"> Male<br> <input name="01gender" type="radio" value="female"> Female<br> </p> <p> <b>Parents' Education Level</b><br> <input name="02parent" type="radio" value="high school"> High School<br> <input name="02parent" type="radio" value="Community College"> Community College<br> <input name="02parent" type="radio" value="Technical College"> Technical College<br> <input name="02parent" type="radio" value="Bachelor's Degree"> Bachelor's Degree<br> <input name="02parent" type="radio" value="Master's Degree"> Master's Degree<br> <input name="02parent" type="radio" value="Doctoral Degree"> Doctoral Degree<br> </p> <p> <b>What are your main hopes and goals for your overall college experience?</b><br> <textarea name="03experience" rows="4" cols="60"></textarea> </p> <p><input type="Submit" value="Submit"></p> </form> </body> </html> Required FieldsForm ActionYour form must contain the following FORM tag in order to be processed correctly. <form method="post" action="http://www.vt.edu/cgi-bin/disgroup/generic-mailer.pl"> This line defines where the e-mail from this form will be sent. The value should contain no more than three comma-separated addresses, all of which must be @vt.edu addresses. <input type="hidden" name="email" value="jane.doe@vt.edu"> formatThe format field lets the mailer know how to format the contents of the e-mail message. In this example, we use text since the mail from this form will be processed by a human being. Other options include: filepro, msql, and oracle for creating database queries. <input type="hidden" name="format" value="text"> redirectOnce a user submits the form, their browser will be sent to the web site specified by the redirect field. Usually this is a page thanking the user for submitting the form, but it could also go to your site's home page. <input type="hidden" name="redirect" value="http://www.vt.edu/"> Optional Fieldsfrom<input type="hidden" name="from" value="john.doe@vt.edu"> The from field lets you specify what shows up in the "From" of the generated e-mail address. If nothing is specified, the value will be "mailer@worf.cc.vt.edu". replyto<input type="hidden" name="replyto" value="john.doe@vt.edu"> Use the replyto field to determine where replies to this message are sent. If nothing is specified, the value of the from field will be used. subject<input type="hidden" name="subject" value="Student Survey"> This value is used for the subject of the e-mail sent. Custom Input Field Naming ConventionsThe forms you create to use the Web Form Mailer are the same as any other form and can contain all valid HTML form elements. The only requirement is that all form elements' NAME attribute must contain a numerical prefix ranging from 00 up to 99. In our template form, for example: <p><b>Student's Major:</b> <input name="00major" type="text" size="30"></p> <p> <b>Gender:</b><br> <input name="01gender" type="radio" value="male"> Male<br> <input name="01gender" type="radio" value="female"> Female<br> </p> In this example, field number 00 is the student's major and field number 01 is the student's gender. Your field names must include the numerical prefix for the Mailer to process and format the data. When the form results are mailed to you, the results will be in the order specified by the prefix. Submit ButtonAt the end of your form, you must have a submit button. This button can be labeled whatever you would like. Back to Web Form Mailer If you have questions or need help using the Web Form Mailer, send an e-mail message to the Web Hosting team at hosting@vt.edu. |
|
||||