HTMaiL is a form-to-email script written in Perl5. It was originally conceived by David Disser (disser@engin.umich.edu), and has been subsequently enhanced for both feature set and general correctness. It works without any arguments to generate a form, or with POST input as a back end to that form.
Note: HTMaiL service via www.engin.umich.edu is only
available to University of Michigan College of Engineering Faculty, and Staff.
Users with CAEN accounts can use the HTMaiL on
www-personal.engin.umich.edu.
Because HTMaiL sends mail that is even less authenticated (if that's possible) than typical SMTP mail, you must first send a message to web-support@icpsr.umich.edu requesting that your email address be validated for use with HTMaiL.
Once you've been validated (you will receive an email notification of this),
simply open the URL https://www.icpsr.umich.edu/cgi-bin/htmail2/your_email_address to create a generic email form.
(Note: the exact form of your_email_address that you should use will
be specified in the email notifying you of your validation to use HTMaiL. You should only use a
full user@domain.edu style address if that is what you were assigned.)
Check out this simple example.
The form can be saved as html text from your browser, then edited to
include any special customizations you might need. Here is a
modified example.
If you would like to use HTMaiL as back end for other forms, any fields not
labeled body, to, mailto, successURL, ccme
refpage, subject, bodytemplate or from
will be included at the end of the message, partially parsed
(see templating information below). The fields named above have special
meaning to HTMaiL and should not be used as custom fields in your forms. The
contents of the fields apparently-from and apparently-subject
will be parsed and placed into both the body of the message and the appropriate message header
fields ('from', and 'subject', respectively).
All of the above fields are optional, with the exception that a valid form must contain at
least two fields that resolve to 'from' and 'to'. This can be any combination
of from or apparently-from, and to or mailto.
If you would like to redirect a successful
posting to a page you maintain, rather than the normal, stock output
that displays, you can set your form's successURL field to the desired URL.
Note: this must be the fully-qualified URL of the success page, not just the name of the file.
This can be done by adding a line like:
<input type="hidden" name="successURL" value="http://www.icpsr.umich.edu/path/to/my/filename.html">To your custom HTMaiL form.
HTMaiL v1.1 has several new features. You can now create a custom
template that will be used in place of the body of the message sent to you via
HTMaiL. Templates are located in the /usr/caen/www/srvr14/htdocs/templates
directory and are referenced in your custom form using the bodytemplate field.
If both the bodytemplate and body fields are present, the body
of the message will be included as normal, and the template will appear at the bottom of the email.
If you specify a template, custom fields must be dealt with by your template, as
they will not be included at the end of the email.
HTMaiL will read in the template and replace occurrences of 'HTMAIL:variable' with the
contents of the field 'variable' from your form. An example template would look something
like:
Dear HTMAIL:first_name, How have you been? Has the weather in HTMAIL:city been treating you okay? I thought I might call you up at HTMAIL:phone, but then realized it'd be much cooler to drop you a line in your inbox: HTMAIL:email
Where first_name, city, phone, and email are all custom field names on your form. Values of 'Webmaster', 'Ann Arbor', '763-5041', and 'webmaster@engin.umich.edu', entered into this form respectively, would result in a message like:
Dear Webmaster, How have you been? Has the weather in Ann Arbor been treating you okay? I thought I might call you up at 763-5041, but then realized it'd be much cooler to drop you a line in your inbox: webmaster@engin.umich.edu
Contact web-support@icpsr.umich.edu for more information on, and help with setting up a template for your custom HTMaiL forms.
The recipient of the email message generated by this gateway can be specified using any one of several methods.
The most common method of doing this is in the ACTION field of the HTML form used for submitting the messages. An example of this method is shown below:
<form method="POST" action="https://www.icpsr.umich.edu/cgi-bin/htmail2/your_email_address">
Recipients can also be specified via a 'mailto' field in the HTML form itself. This must be used in conjunction with a form ACTION attribute set to "https://www.icpsr.umich.edu/cgi-bin/htmail2". (See the example below.) If there is a user specified in the ACTION attribute (as seen above), the 'mailto' field is optional, and will not be used.
This allows you to do fun things like using a single form to send mail to one of several email addresses. This might be done by adding lines similar to:
<form method="POST" action="https://www.icpsr.umich.edu/cgi-bin/htmail2">
Subject:<SELECT name="subject">
<OPTION>Just a friendly message
<OPTION>About the homepage...
<OPTION>Something else...
</SELECT>
This should be sent to: <SELECT name="mailto">
<OPTION selected>webmaster
<OPTION>web-support
</SELECT>
to your form.
If you have any questions about the use of HTMaiL, please send mail to web-support@icpsr.umich.edu.
PERMISSION IS GRANTED TO USE, COPY AND REDISTRIBUTE THIS SOFTWARE FOR NON-COMMERCIAL EDUCATION AND RESEARCH PURPOSES, SO LONG AS NO FEE IS CHARGED, AND SO LONG AS THE COPYRIGHT NOTICE ABOVE, THIS GRANT OF PERMISSION, AND THE DISCLAIMER BELOW APPEAR IN ALL COPIES MADE; AND SO LONG AS THE NAME OF THE UNIVERSITY OF MICHIGAN IS NOT USED IN ANY ADVERTISING OR PUBLICITY PERTAINING TO THE USE OR DISTRIBUTION OF THIS SOFTWARE WITHOUT SPECIFIC, WRITTEN PRIOR AUTHORIZATION. PERMISSION TO MODIFY OR OTHERWISE CREATE DERIVATIVE WORKS OF THIS SOFTWARE IS NOT GRANTED. THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION AS TO ITS FITNESS FOR ANY PURPOSE, AND WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE FOR ANY DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM ARISING OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.