#!/usr/bin/perl -w
use strict;
# This Perl script serves as an example of how to use Mailer::Simple.pm
# See end of this file for boring liscence information.
use Mailer::Simple;
my($mailman) = Mailer::Simple->new();
=pod
Mailer::Simple is freely available at the ooOPps Open Source Code Library
under its "modules" section. The ooOPps Code Library is at
<URL: http://ooopps.sourceforge.net/pub/ >
Mailer::Simple will handle the validation of all your input. You don't
have to worry about checking for required arguments or whatever. Errors
are reported in HTML output if your program is running as a CGI script on
the WWW. Otherwise, error messages are printed out raw to STDERR.
Mailer::Simple does not currently validate email addresses for correct
syntax though. That is up to you.
For all options which require an email address, you can use an
email address only, or an address accompanied by a mail handle.
(see comments at the end of this code for a complete list of options
you can pass to the mail() command in Mailer::Simple)
Example syntax for valid email addresses-
email address only: foo@bar.bz
email address with a mail handle: "Foo Bar" <foo@bar.bz>
=cut
$mailman->mail
(
# email address for the sender of this message
'from' => $cgi->param('from') || undef,
# email address for the recipient of this message
'to' => $cgi->param('to') || undef,
# you can specify an email address of someone to whom you wish to
# direct a 'carbon copy' of the email.
'cc' => $cgi->param('cc') || undef,
# you can specify an email address of someone to whom you wish to
# direct a 'blind carbon copy' of the email.
'bcc' => $cgi->param('bcc') || undef,
# the email address at which you wish receive replies to this message
'reply to' => $cgi->param('reply to') || undef,
# subject of the message
'subject' => $cgi->param('subject') || undef,
# message body
'message' => $cgi->param('message') || undef,
# the number of columns at which to wrap plain-text email.
# defaults to a value of '80'
'wrap at' => $cgi->param('wrap at') || undef,
# defaults to 'text/plain', but you can set it to 'text/html' if you
# want to send an email in formatted html by assigning a value of
# 'text/html' to this argument
'contype' => $cgi->param('contype') || undef,
);
=pod
You can pass any of these arguments to the mail() command in Mailer::Simple
as shown in the example above.
to
cc
bcc
from
reply to
subject
sender
contype
charset
x-mailer
summary
keywords
organization
precedence
priority
class
status
=cut
=pod
AUTHOR
Tommy Butler <cpan@atrixnet.com>
phone: (817)-468-7716
6711 Forest Park Dr
Arlington, TX
76001-8403
COPYRIGHT Tommy Butler, all rights reserved.
LISCENCE This library is free software, you may redistribute
and/or modify it under the same terms as Perl itself.
This code uses a Perl module (or reusable code library) to make life easier
when doing things with files. You can download the code at:
<http://ooopps.sourceforge.net/cgi-bin/archive.pl/pub/modules/Futils.pm>
Futils uses other modules, which may be also be found here at the
ooOPps Open Source Code Library under the "modules" section. Refer to the
itemized list below for more specific information:
"Handy::Dandy"
used by: Futils
file name Dandy.pm
get it at: /pub/modules/Handy/Dandy.pm
"OOorNo"
used by: Futils, Handy::Dandy
file name: OOorNo.pm
get it at: /pub/modules/OOorNo.pm
"Handy::Dandy::TimeTools"
used by: Handy::Dandy
file name: TimeTools.pm
get it at: /pub/modules/Handy/Dandy/TimeTools.pm
=cut