unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (Debian-5.0)
Page:
Section:
Apropos / Subsearch:
optional field

Mail::Mailer(3pm)     User Contributed Perl Documentation    Mail::Mailer(3pm)



NAME
       Mail::Mailer - Simple interface to electronic mailing mechanisms

INHERITANCE
        Mail::Mailer
          is a IO::Handle

SYNOPSIS
         use Mail::Mailer;
         use Mail::Mailer qw(mail);    # specifies default mailer

         $mailer = Mail::Mailer->new;
         $mailer = Mail::Mailer->new($type, @args);

         $mailer->open(\%headers);
         print $mailer $body;
         $mailer->close;

DESCRIPTION
       Sends mail using any of the built-in methods.  As TYPE argument to
       new(), you can specify any of

       "sendmail"
           Use the "sendmail" program to deliver the mail.

       "smtp"
           Use the "smtp" protocol via Net::SMTP to deliver the mail. The
           server to use can be specified in @args with

               $mailer = Mail::Mailer->new('smtp', Server => $server);

           The smtp mailer does not handle "Cc" and "Bcc" lines, neither their
           "Resent-*" fellows. The "Debug" options enables debugging output
           from "Net::SMTP".

           You may also use the "Auth => [ $user, $password ]" option for SASL
           authentication (requires Authen::SASL and MIME::Base64).

       "qmail"
           Use qmail's qmail-inject program to deliver the mail.

       "testfile"
           Used for debugging, this displays the data to the file named in
           $Mail::Mailer::testfile::config{outfile} which defaults to a file
           named "mailer.testfile".  No mail is ever sent.

       "Mail::Mailer" will search for executables in the above order. The
       default mailer will be the first one found.

METHODS
       Constructors

       Mail::Mailer->new(TYPE, ARGS)

           The TYPE is one of the back-end sender implementations, as
           described in the DESCRIPTION chapter of this manual page.  The ARGS
           are passed to that back-end.

       $obj->open(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, "gnatATfrii.com") or a reference to an array of scalars ("eg,
           ['gnatATfrii.com', 'Tim.BunceATig.uk']").

DETAILS
       ENVIRONMENT VARIABLES

       PERL_MAILERS
           Augments/override the build in choice for binary used to send out
           our mail messages.

           Format:

               "type1:mailbinary1;mailbinary2;...:type2:mailbinaryX;...:..."

           Example: assume you want you use private sendmail binary instead of
           mailx, one could set "PERL_MAILERS" to:

               "mail:/does/not/exists:sendmail:$HOME/test/bin/sendmail"

           On systems which may include ":" in file names, use "|" as separa-
           tor between type-groups.

               "mail:c:/does/not/exists|sendmail:$HOME/test/bin/sendmail"

       BUGS

       Mail::Mailer does not help with folding, and does not protect against
       various web-script hacker attacks, for instance where a new-line is
       inserted in the content of the field.

SEE ALSO
       This module is part of the MailTools distribution, http://perl.over-
       meer.net/mailtools/.

AUTHORS
       The MailTools bundle was developed by Graham Barr.  Later, Mark Over-
       meer took over maintenance without development.

       Mail::Cap by Gisle Aas <aasAToslonett.no>.  Mail::Field::AddrList by
       Peter Orbaek <poeATcit.dk>.  Mail::Mailer and Mail::Send by Tim Bunce
       <Tim.BunceATig.uk>.  For other contributors see ChangeLog.

LICENSE
       Copyrights 1995-2000 Graham Barr <gbarrATpobox.com> and 2001-2007 Mark
       Overmeer <perlATovermeer.net>.

       This program is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.  See
       http://www.perl.com/perl/misc/Artistic.html



perl v5.8.8                       2008-04-14                 Mail::Mailer(3pm)