Email.cgi version 2.0.1


This page documents email.cgi version 2.0.1

  1. Introduction and version
  2. System requirements and installation
  3. Error messages
  4. Release Notes


Introduction and version

Email.cgi is a CGI script to be used on MacHTTP servers for the purposes of sending email from WWW browsers who are not mailto-capable. In other words, it allows you, as a WWW systems administrator to allow people to send email messages from your server without the need of your users to have WWW clients who understand the email protocol. At the present time, this includes most versions of Mosaic, Cello, as well as MacWeb.

The current version of email.cgi is 2.0.1 and is available at ftp://ftp.lib.ncsu.edu/pub/software/mac/email-cgi.hqx.

System requirements and installation

NOTE! The OSAX used in this script, as well as the layout of the FORM are significantly different from previous versions. If you are upgrading, then please take care to notice these differences.

Email.cgi requires:

Email.cgi also requires a forms-capable WWW browser at the client end.

Download the scripting additions and read their instructions. Most importantly, install the scripting additions themselves into the Scripting Additions folder of your Extenstions Folder of your System Folder.

The email.cgi AppleScript itself requires no configuration, but if you do happen to edit it, make sure you save it as an application that stays open and never shows a startup screen.

All the configuration for email.cgi lies in the form calling email.cgi. Below is a generic, but valid form for sending commands to email.cgi:

<html>
<head>
<title>Send a message to Eric Lease Morgan</title>
</head>

<body>
<H2>Send a message to Eric Lease Morgan (eric_morgan@ncsu.edu)</H2>
<FORM METHOD="POST" ACTION="http://emorgan.lib.ncsu.edu/email.cgi">

<INPUT TYPE="hidden" NAME="to_name" VALUE="Eric Lease Morgan">
<INPUT TYPE="hidden" NAME="to_address" VALUE="eric_morgan@ncsu.edu">
<INPUT TYPE="hidden" NAME="mailer" VALUE="mail-relay.ncsu.edu">

What is your name?<BR>
<INPUT TYPE="text" NAME="from_name" SIZE="40" MAXLENGTH="40"><P>

What is your email address<BR>
<INPUT TYPE="text" NAME="from_address" SIZE="40" MAXLENGTH="40"><P>

What is the subject of your message<BR>
<INPUT TYPE="text" NAME="subject" SIZE="40" MAXLENGTH="40"><P>

What do you want to say?<BR>
<TEXTAREA NAME="message" ROWS=6 COLS=40></TEXTAREA><P>
<INPUT TYPE="Submit" VALUE="Send the message"> <INPUT TYPE="reset" VALUE="Reset">
</FORM>

</body>
</html>


Here is how to edit this generic form to meet your needs:
  1. Edit the title to anything you want.
  2. Change the first header to anything you want.
  3. Edit the ACTION field of the FORM line to reflect the URL of your copy of email.cgi.
  4. Edit the VALUE field of the first INPUT TYPE to reflect the name of the person whom you want to recieve the mail
  5. Edit the VALUE field of the second INPUT TYPE to reflect the email address of the person whom you want to recieve the mail
  6. Edit the VALUE field of the thid INPUT TYPE to reflect the Internet address of computer you know can forward email.
  7. Edit anything else you like, but don't change the contents of any of the NAME fields!

After editing your form, save it, and point to it via another HTML document. For example, if my Macintosh server is up and running, then you can send me mail at eric_morgan@ncsu.edu.

If all works well, you should get back some feedback telling you the message has been queued for delivery. Otherwise, you will recieve an error message.

Error messages

Email.cgi generates only contains three error messages: PARSE, COMMUNICATIONS, FEEDBACK.
1. PARSE ERROR
This error occurs while trying to parse the post data from the form. Make the NAME fields of the form have not been changed, and make sure you have entered informaiton into every field of the form.

2. COMMUNICATIONS ERROR
This error occurs while trying to send your message. Make sure the mailer you specifiy is a valid mailer, and make sure you have entered your full and complete email address.

3. FEEDBACK ERROR
This error shouldn't ever happen because I've looked and looked at this code and if you didn't get a parse error, then you shouldn't get anything here.

Release Notes

Version 2.0.1 (July 20, 1995) - Upon futher examination, I realized the MAIL FROM: SMTP command, as well as the RCPT TO: command, I was implementing was incorrect; I was including human names in these command when that is not what you are suppose to do. Consequently, after removing the human names from these commands, email.cgi works with more mailers. "Thank you, Bill Bowman."

Version 2.0 (July 10, 1995) - After being given an SMTP library from Atul Butte, I changed the script to include the HELO command for initialting SMTP communications. This, as well as a few slight modifications to the library should make email.cgi work happily with MailShare. Whew! I also upgraded the script with the use of the Parse CGI OSAX thus eliminating the tedious method of extracting the POST arguments from the FORM. Very nice! Lastly, I added much more error trapping and consequently, it is no less prone to returning garbage.

Version 1.0.2 (January 6, 1995) - Prompted by Todd Main, and using code from Tom Coradeschi, I changed email.cgi to inclued the ability to send the end-user's name as well as their adress in the email header. "Thanks guys!"

Version 1.0.1 (November 9, 1994) - IMHO, the TCP Scripting Additions version 1.1.2 were not backwards compatible with version 1.1. Specifically, the calls to the ISO translation tables were changed. Consequently, the older compiled version of email.cgi did not work. By installing the newer version of the Scripting Additions (1.1.2) and recompiling email.cgi, the problems with email.cgi and Scripting Additions have disappeared. Thus, email.cgi version 1.0.1 is not backwards compatible either. Arggg...

Version 1.0 (November 2, 1994) - original release


This page is maintained by Eric Lease Morgan (eric_morgan@ncsu.edu), and it was last modified July 11, 1995.

Go to library's home page. Go to NCSU's home page.

<URL:http://www.lib.ncsu.edu/staff/morgan/email-cgi.html>