University of North Dakota
School of Medicine & Health Sciences

Sending a Web Form through E-Mail

The UNDSMHS web server includes support for sending a filled-in Web form through e-mail. Check out an example form to see this feature in action.

The HTML form should be setup with the method set to "POST" and action to "http://www.med.und.nodak.edu/mailform", as in:

<form method="POST" action="http://www.med.und.nodak.edu/mailform">
   ...
</form>

Details on how the message should be sent are controlled by fields within the form that have names beginning with "mail-".  Normally these fields are of type "hidden", but they don't have to be.
 

Special fields for the "mailform" action
mail-to
mail-cc
mail-bcc
Value is a medicine.nodak.edu e-mail address that the message should be sent to.  You can have as many of these within a form as you want, but there must be at least one.

Example:

<input type="hidden" name="mail-to" value="joe@medicine.nodak.edu">
<input type="hidden" name="mail-to" value="bob@medicine.nodak.edu">
<input type="hidden" name="mail-cc" value="sue@medicine.nodak.edu">

Would cause the form to be sent to 3 addresses.

mail-from Value is the return address of the mail message.  For example: 

Your Address: <input name="mail-from"> 
Would cause

Your Address: 


To appear in the form, and whatever the user typed there would be the return address of the sent message.

mail-subject Value is the subject of the message, for example:

<input type="hidden" name="mail-subject" value="Web Request">

mail-response Value is a short bit of text displayed to the user after submitting the form. For example:

<input type="hidden" name="mail-response" value="Thank you">

(It's not very pretty - the "mail-redirect" feature allows for a fancier response to the user).

mail-redirect Value is the URL of a webpage the user should be shown after submitting the form. For example:

<input type="hidden" name="mail-redirect" value="http://www.yahoo.com">

Would cause the Yahoo homepage to come up after the user submitted the form.

We had some problems mailing HTML forms to people using WordPerfect Groupwise, and found that it was necessary to have a way to tell the webserver to attach the form as a binary attachment and sometimes specify a name for the attachment. These last two commands allow you do to deal with those strange cases.
mail-forceattach If the value is "Y" then the web server will force the HTML in the mail message to be treated like an attached binary file instead of attached text.  For example:

<input type="hidden" name="mail-forceattach" value="Y">

mail-attachname Specify a name for the HTML attachment to the mail message. For example:

<input type="hidden" name="mail-attachname" value="request.html">


Valid HTML 4.01! Barry Pederson <barryp@medicine.nodak.edu>
Revised 3/21/2006