Resources
HOWTO Documents > Form Mailer
This gateway provides the ability to mail the contents of a form to your CCIS account.
Usage
This gateway may be used from an HTML page by including a form which
uses the following sample syntax:
<form method="post" action="/cgi-bin/form-mailer">
<input type="hidden" name="ccsusername" value="USERNAME">
Enter your comments below:
<textarea name="comments" rows="10" cols="60">
</textarea>
<p>
If you would like a reply to your comments,
please provide me with
your name and eMail address.
<p>
Your Name: <input type="text" name="full_name">
<p>
eMail Address: <input type="text" name="email">
<p>
To send your comments select:
<input type="submit" value="Send Comments">
<p>
</form>
Where USERNAME is your CCIS login (account) name. You must include this, otherwise the script won't know who to send the eMail to.
When the user selects "Send Comments", the gateway will attempt to send you mail. If it succeeds, it will return a message to the client saying that the eMail was successfully sent.
Additional Features
To provide a custom page after eMail has been successfully sent, you can include one of the following tags in your form:
| <input type="hidden" name="redirect" value="/some/path/filename.html"> | |
| or | |
| <input type="hidden" name="redirect" value="http://www.example.com/some/path/filename.html"> |
In the first case, the user will be redirected to the page specified, which is served from our web server. In the second case, the user will be redirect to the new server and document.
By default the form fields are sorted by name before being sent to
you. If you wish to disable form field sorting add the following tag
to your form data:
<input type="hidden" name="sortnames" value="no">
By default the eMail sent has the subject of "Form Mailer Gateway eMail". If you wish to change it, add the following tag to your form data:
| <input type="hidden" name="emailsubject" value="Custom Subject"> |
There are restrictions on the characters that you can use in the subject. The allowed characters are: a-z A-Z 0-9 , . ? ! " ' : -
Authorization
This gateway requires an authorization file before it will send eMail
to your account. We require this authorization, because the gateway
allows people to send you anonymous mail rather easily. There is the
possibility that a user on the net would abuse this, so by creating
the authorization file you realize that such actions could occur. To
enable this service, you need to create the special file
"~/.www/.allow-form-mail". You can do this with the command:
touch ~/.www/.allow-form-mail
Backwards Compatibility
This interface still supports the old style form-mailer syntax but no longer documents it because it violated the CGI specification. If you get a chance you should convert to the new format explained above as new features which require the new syntax maybe added in the future.
This interface uses hidden values in order to pass information to the script. If you are using the old interface and have have a form field named either "ccsusername", "redirect", or "sortnames" it will not be sent in eMail. Sorry for the change in behavior.