info

Current Computing Status:

Service Info

This IT Status feed has been decommissioned as of 02/13/2017.  We now have a new Services Status on our ServiceNow platform.  Please visit 4help.vt.edu to view our current Services Status. view Status History All Active Statuses

Quick Start: Web Form Mailer

The Web Form Mailer works by taking structured input from a web form and processing it to create an email message that is sent to a specified email address. Parameters for the mailer are set by using hidden form fields.


Sample Form

This 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 email address, save it, and put it online to have a fully-functioning email 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 Fields

Form Action

Your 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">

email

This line defines where the email 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">

format

The format field lets the mailer know how to format the contents of the email 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">

redirect

Once 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 Fields

from

<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 email 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 email sent.


Custom Input Field Naming Conventions

The 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 Button

At the end of your form, you must have a submit button. This button can be labeled whatever you would like.


Other Resources
Wed, 02/01/2012 - 3:55pm 5950 Views