Access Keys:
Skip to content (Access Key - 0)

Using cgiemail on web.mit.edu to create an email form hosted on a different site

Context

  • You have a web site hosted on a server other than web.mit.edu (for example, kb.mit.edu, wikis.mit.edu, a Drupal site, etc.)
  • You need a web form that sends email but do not want to install and manage an email agent on your server

Answer

As long as you can insert an HTML form on one of your pages, you can call MIT's version of cgiemail, a script that processes your web form submission and sends email, from a form hosted on your site.

0. General information on cgiemail

You can find general information on cgiemail in the cgiemail user guide at http://web.mit.edu/wwwdev/cgiemail/user.html. Note that this user guide is not MIT specific.

1. Critical MIT-specific info

There are the two cgi programs installed on http://web.mit.edu that you can use in your form tag's "action=" parameter:

  • http://web.mit.edu/bin/cgiemail
  • http://web.mit.edu/bin/cgiecho

The first is the actual cgiemail script. The second is a version that will allow you to test your setup without actually sending mail. It will display the mail it would have sent, without sending it. So you'll want to test with cgiecho while you are developing your form, then replace it with cgiemail when you're ready to send real email.

An full action parameter will look something like this:

  • action="http://web.mit.edu/bin/cgiemail/afs/athena.mit.edu/org/m/myorganization/myform/emailtemplate.txt"

where the part after "cgiemail" is the full path to an email template file you need to create in AFS, MIT's shared file system.

2. Examples

a. Example form using this technique

You can see an example setup of a web form hosted on a different site (wikis.mit.edu) but submitting through cgiemail on web.mit.edu at the following location. The form is at the bottom of this wiki page:

b. Look at wiki markup

You can look at the page's source and the wiki markup used to insert the HTML form at:

c. Examine the email template

The email template referenced by the form is at:

(The AFS path is just /afs/athena.mit.edu/astaff/project/helpdesk/forms/llp-request.txt if you are looking at the file directly in AFS instead of through a web browser.)

See also

IS&T Contributions

Documentation and information provided by IS&T staff members


Last Modified:

August 20, 2014

Get Help

Request help
from the Help Desk
Report a security incident
to the Security Team
Labels:
c-web-publishing c-web-publishing Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
Feedback
This product/service is:
Easy to use
Average
Difficult to use

This article is:
Helpful
Inaccurate
Obsolete
Adaptavist Theme Builder (4.2.3) Powered by Atlassian Confluence 3.5.13, the Enterprise Wiki