CGI::ContactForm is a Perl module that can generate a web contact form.
recname => 'John Smith',
recmail => 'email@example.com',
styleurl => '/style/ContactForm.css',
This module generates a contact form for the web when the routine contactform() is called from a CGI script. Arguments are passed to the module as a list of key/value pairs.
CGI::ContactForm sends a well formated (plain text format=flowed in accordance with RFC 2646) email message, with the sender's address in the From: header.
By default the sender gets a bcc copy. If the email address stated by the sender is invalid, by default the failure message is sent to the recipient address, through which you know that you don't need to bother with a reply, at least not to that address... However, by setting the nocopy argument you can prevent the sender copy from being sent.
CGI::ContactForm takes the following arguments:
returnlinktext 'Main Page'
maxsize 100 (KiB)
spamfilter '(?i:|[/url])' (Perl regex)
Additional arguments, intended for forms at non-English sites
title 'Send email to'
namelabel 'Your name:'
emaillabel 'Your email:'
erroralert 'Fields with %s need to be filled or corrected.'
marked 'marked labels'
thanks 'Thanks for your message!'
sent_to 'The message was sent to %s with a copy to %s.'
sent_to_short 'The message was sent to %s.'
There are only two compulsory arguments. The example CGI script contact.pl, that is included in the distribution, also uses the styleurl argument, assuming the use of the enclosed style sheet ContactForm.css. That results in a decently styled form with a minimum of effort.
If the default value localhost isn't sufficient to identify the local SMTP server, you may need to explicitly state its host name or IP address via the smtp argument.
As you can see from the list over available arguments, all the text strings can be changed, and as regards the presentation, you can of course edit the style sheet to your liking.
If you want to modify the HTML markup, you can have CGI::ContactForm make use of one or two templates. The enclosed example templates ContactForm_form.tmpl and ContactForm_result.tmpl can be activated via the formtmplpath respective resulttmplpath arguments, and used as a starting point for a customized markup.
What's New in This Release: [ read full changelog ]
· MIME encoding (quoted-printable) of bytes representing non-ASCII characters was added.
· Max line length will refer to characters, not bytes (if Encode is installed).