Step 2: Call the MailTo CGI
When a form is submitted, the MailTo CGI sends the results of the form to a specified cmu.edu address. To specify the required email address, do the following:
- Edit the form line adding an action set to the URL of the MailTo CGI and a method set to "post". Depending on where you are publishing to, and assuming that you have named the form "myform", enter the line as follows:
- If you are using the Andrew Web publishing system or Content Management System (CMS) to publish on www.cmu.edu enter one of the following:
Web-ISO restricted pages:
<form id="myform" name="myform" method="post" action="https://www.cmu.edu/cgi-bin/mailto">
Pages that are not restricted:
<form id="myform" name="myform" method="post" action="http://www.cmu.edu/cgi-bin/mailto">
- If you are publishing on www.andrew.cmu.edu, enter the line as follows:
<form id="myform" name="myform" method="post" action="http://www.andrew.cmu.edu/cgi-bin/mailto">
- Add the hidden field, "MailTo" with the value set to the email address that will receive the form results. Be sure to add the line after the <form> tag but before the </form> tag.) The "MailTo" hidden field has the format:
<input name="MailTo" type="hidden" value="userid@realm" />
Where userid@realm is the email address of the person who should receive the mail.
- If you want, add the hidden field, "MailCC" with the value set to the email address of a second person or a bulletin board who will receive the form results. Be sure to add the line after the <form> tag but before the closing </form> tag. The "MailCC" hidden field has the format:
<input name="MailCC" type="hidden" value="userid@realm" />
Where userid@realm is the e-mail address of the person who should be cc'd on the mail, or the bulletin board that you want to cc to.
Note: When posting to a bulletin board, you must prefix the bboard name with "post+". For example, to post to the bboard at org.acs.documentation, you would enter that value as post+org.acs.documentation@andrew.cmu.edu.
See the examples below to view the detailed HTML:
- If the email address you specified above is going to a cmu.edu address (such as @andrew.cmu.edu, @cs.cmu.edu, etc.), continue with Step 4: Format the Response or Redirect Page (Optional).
If the email address you specified is going to an address outside of the cmu.edu domain, follow Step 3: Adding Approved Email Addresses. The MailTo CGI will send email to any recipient within the cmu.edu domain, but to prevent abuse by spammers, it will ONLY send mail to non-cmu.edu email addresses if an authenticated Andrew user approves the destination email address in advance.