FormMail
From Wikipedia, the free encyclopedia
Formmail and its many variants, is a type of web site script, that captures and processes the form contents and then typically emails them to one or more recipients.
The script originally created in Perl is credited to Matt Wright of Matt's Script Archive, is available today in many web programming languages.
[edit] Operation
The script operates, by reading iteratively reading all the form fields, from the submitted form via the form ACTION tag. Next the script begins to build an e-mail message, from the submitted fields, typically concatenating the name and value of each submitted form field in the body of the email message.
The script uses several specially-named hidden fields to control the operation of the script. The various hidden fields control who the recipient of the email is, what the email subject is set to, etc. Finally the script emails the form's contents to the recipient(s).
The typical Frommail script has this common functionality:
-
- Reads All form fields and creates an email message from them
- Recipient fields (typically hidden) allow creator to determine emial recipient
- Subject field, allows the creator to set the Subjectof the email in a hiddenform field
- Required fields, allows you to set which fields need to be completed to send the email
- CC, BCC fields, allow you to copy and forward to multiple recipients
[edit] Form Setup
Create a form the is to be used via formmail is a pretty straightforward process. Create the form using standard HTML formsetup. Then point the Action tag, to the name of the formmail script. Below is a simple form example that simply captures a site visitors name, and email address
More advanced variants of the script have additional features such as: provide for email attachments, prevent form spamming, save the email to a file or database, add captcha validation and more.
Today a variant of the script exists for most popular web scripting languages, such as Perl, ASP (ASP.NET) , PHP, ColdFusion, Java.