- VERSION HISTORY
- LATEST VERSION
- AUTHOR, COPYRIGHT AND LICENSE
CGI::ContactForm - Perl extension for generating a web contact form
#!/usr/bin/perl use lib '/path/to/lib'; (For the case this module, or any module it's dependent on, is installed in a local library.) use CGI::ContactForm; contactform ( recname => 'John Smith', \ recmail => 'email@example.com', } Compulsory smtp => 'smtp.domain.com', / styleurl => '/style/ContactForm.css', \ returnlinktext => 'Back', } Optional returnlinkurl => '/some/url', / );
This module generates a contact form for the web when the routine
contactform() is called from a CGI script. The CGI script shall consist of just a few lines of code like in the example under SYNOPSIS above. The 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, and the sender gets a
bcc copy. If the email address stated by the sender is invalid, 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...
Type the following:
perl Makefile.PL make make test make install
Download and extract the distribution file.
Designate a directory as your local library for Perl modules, for instance
Create the directory
/cgi-bin/lib/CGI, and upload
ContactForm.pmto that directory.
Text::Flowed (see DEPENDENCIES below) need to be installed manually, you shall create
/cgi-bin/lib/Text and upload
Flowed.pm to those directories.
CGI::ContactForm requires these modules, available at CPAN:
It also requires direct access to an SMTP server.
An example CGI script (
contact.pl) and a style sheet (
ContactForm.css) are included in the distribution. Note that the style sheet typically needs to be located somewhere outside the cgi-bin.
- v0.4 (Feb 9, 2003)
Error alert message added. Also
ContactForm.csswas modified for this reason.
Test script included in the distribution.
- v0.3 (Feb 7, 2003)
Check of email syntax modified (hopefully now closer to RFC 822).
Better structured code.
- v0.2 (Feb 5, 2003)
Referer check in order to only accept data input from the generated form.
Improved email validation.
- v0.1 (Feb 3, 2003)
The latest version of
CGI::ContactForm is available at: http://search.cpan.org/author/GUNNAR/ and http://www.gunnar.cc/contactform/
Copyright © 2003 Gunnar Hjalmarsson http://www.gunnar.cc/cgi-bin/contact.pl
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 126:
Non-ASCII character seen before =encoding in '©'. Assuming ISO8859-1