CGI-FormBuilder-Mail-FormatMultiPart
view release on metacpan or search on metacpan
lib/CGI/FormBuilder/Mail/FormatMultiPart.pm view on Meta::CPAN
skipfields => ['field1','field2'], # optional
format => 'plain', # or 'html' or 'both'
html_qt_format => { }, # HTML::QuickTable args
css => $css, # scalar in-line css
);
}
=head1 DESCRIPTION
A plugin for CGI::FormBuilder to prettily send the form submission
via e-mail, without requiring the presence of sendmail on the system
or using a shell escape (i.e. Windows). It uses MIME::Lite to build
the message and that module's interface to Net::SMTP to send it.
Default message format is 'plain' but you can specify 'html' or 'both',
which results in a multipart message. (Not sure if I have that right yet.)
If HTML, can pass a stylesheet that is printed in-line, as well as
arguments to HTML::QuickTable. ('header' is ignored.) The default
style class is 'fb_mail' for all elements. You can use a partial CSS spec
to override this class's styles; defaults will otherwise still apply.
Will attach all file uploads as multipart MIME attachments.
The file names are listed in the form data table.
If it cannot be used, it will puke a warning message and die.
=head1 INSTALLATION
If you cannot use CPAN or PPM in the normal way, then:
perl Build.PL
./Build
./Build test
./Build install
You need superuser/administrator privileges for the last step.
=head1 WRITING YOUR OWN PLUGIN
This establishes a simple mail plugin implementation standard
for your own mailresults() plugins. The plugin should reside
under the CGI::FormBuilder::Mail::* namespace.
It should have a constructor new() which accepts
a hash-as-array of named arg parameters, including form => $form.
It should have a mailresults() object method that does the right thing.
It should use CGI::FormBuilder::Util and puke() if something goes wrong.
Calling $form->mailresults( plugin => 'Foo', ... ) will use
CGI::FormBuilder::Mail::Foo and will pass the FormBuilder object
as a named param 'form' with all other parameters passed intact.
If it should croak, confess, die or otherwise break if something
goes wrong, FormBuilder.pm will warn any errors and the built-in
mailresults() method will still try.
=head1 BUGS
Styles don't do anything in my copy of Evolution, at least.
But they do have the intended effect in Mozilla Mailnews,
so I guess it's good to go.
=head1 DEPENDENCIES
L<MIME::Types>,
L<Net::SMTP>,
L<MIME::Lite>,
L<Text::FormatTable>,
L<HTML::QuickTable>,
L<CGI::FormBuilder version 3.0301 or higher>
=head1 SEE ALSO
L<CGI::FormBuilder>,
L<MIME::Lite>,
L<Text::FormatTable>,
L<HTML::QuickTable>
=head1 AUTHOR
Copyright (c) 2006 Mark Hedges <hedges@ucsd.edu>.
This module is free software; you may copy this under the terms of
the GNU General Public License, or the Artistic License, copies of
which should have accompanied your Perl kit.
=cut
( run in 0.327 second using v1.01-cache-2.11-cpan-39bf76dae61 )