Mail::Mailer - send simple emails |
Mail::Mailer - send simple emails
Mail::Mailer is an IO::Handle
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 or die "couldn't send whole message: $!\n";
Sends mail using any of the built-in methods. As TYPE argument to new(), you can specify any of
sendmail
sendmail
program to deliver the mail.
smtp
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. To make this work, you have to install the the Authen::SASL manpage
distribution yourself: it is not automatically installed.
smtps
smtp
. You have to install Authen::SASL as
well.
$mailer = Mail::Mailer->new('smtps', Server => $server);
qmail
testfile
$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.
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']
).
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 separator
between type-groups.
"mail:c:/does/not/exists|sendmail:$HOME/test/bin/sendmail"
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.
This module is part of the MailTools distribution, http://perl.overmeer.net/mailtools/.
The MailTools bundle was developed by Graham Barr. Later, Mark Overmeer took over maintenance without commitment to further development.
Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce <Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog.
Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2017 Mark Overmeer <perl@overmeer.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
Mail::Mailer - send simple emails |