NAME

Mail::Mailer - Simple interface to electronic mailing mechanisms

SYNOPSIS

require Mail::Mailer;

$mailer = new Mail::Mailer;

$mailer = new Mail::Mailer $type, @args;

$mailer->open(\%headers);

print $mailer $body;

$mailer->close;

DESCRIPTION

Sends mail using any of the built-in methods. You can alter the behaviour of a method by passing $command to the new method.

sendmail

Use the sendmail program to deliver the mail. $command is the path to sendmail.

mail

Use the Unix system mail program to deliver the mail. $command is the path to mail.

telnet

Telnet to the SMTP port of the local machine. $command is the path to the telnet command. $Mail::Mailer calls $command localhost smtp.

test

Used for debugging, this calls /bin/echo to display the data. No mail is ever sent. $command is ignored.

ARGUMENTS

new can optionally be given a $command and $type. $type is one sendmail, mail, ... given above. The meaning of $command depends on $type.

open is given a reference to a hash. The hash consists of key and value pairs, the key being the name of the header field (eg, To), and the value being the corresponding contents of the header field. The value can either be a scalar (eg, gnat@frii.com) or a reference to an array of scalars (eg, [gnat@frii.com, Tim.Bunce@ig.co.uk]).

TO DO

Assist formatting of fields in ...::rfc822:send_headers to ensure valid in the face of newlines and longlines etc.

Secure all forms of send_headers() against hacker attack and invalid contents. Especially "\n~..." in ...::mail::send_headers.

SEE ALSO

Mail::Send

AUTHORS

Tim Bunce <Tim.Bunce@ig.co.uk>, with a kick start from Graham Barr <bodg@tiuk.ti.com>. With contributions by Gerard Hickey <hickey@ctron.com> For support please contact comp.lang.perl.misc. Small fix and documentation by Nathan Torkington <gnat@frii.com>.

REVISION

$Revision: 1.7 $

The VERSION is derived from the revision turning each number after the first dot into a 2 digit number so

Revision 1.8   => VERSION 1.08
Revision 1.2.3 => VERSION 1.0203