Perl CGI Mailer Scripts
Monday, December 10th, 2007Overview
Submission of form-based information on SML web servers takes place via CGI/Perl mailer scripts based around the freeware FormMail script.
New CGI Mailer Script
A Perl script was written as back-ends for the three web-forms linked from http://www.sml.hw.ac.uk/languages/onlineapplication/
The script are held under S:Apachecgi-binSMTP and is named formmail_eng_for_acad.pl. It is hard-coded to send mail only to Karen Morton, for security, and uses the Blat mailing program on the Apache web server PC. The script writes a return-url, which is passed to it from each web-form as follows:
<form action="/cgi-bin/smtp/formmail_eng_for_acad.pl" method="post" name="english application form">
<input type="hidden" name="required" value="first_name,last_name">
<input type="hidden" name="return_link_title" value="English for academic study and professional purposes">
<input type="hidden" name="return_link_url" value="http://www.hw.ac.uk/langWWW/english/courses/eap_is.html">
As all three forms uses the same Perl mailer script, the name of the form being submitted is identified from the Application_Form hidden field:
<input type="hidden" name="Application_Form" value="Register Online for Advanced Writing"> ÂÂ
Recall that the Apache webserver actually publishes from the C: drive of the web server PC, using a Robocopy script to synchronise with the contents of s:apachehtdocs every minute to ensure web services remain up on the event that the Novell server goes down.
Of future interest, perhaps, is a Perl module that writes directly to an Excel spreadsheet. Time doesn’t permit looking at this further just now.