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";
$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".
[added 2.21] You may also use the "StartTLS => 1" options to upgrade the connection with STARTTLS. You need "libnet" version 1.28 (2014) for this to work.
You may also use the "Auth => [ $user, $password ]" option for SASL authentication. To make this work, you have to install the Authen::SASL distribution yourself: it is not automatically installed.
Use the smtp over ssl protocol via Net::SMTP::SSL to deliver the mail. Usage is identical to "smtp". You have to install Authen::SASL as well.
$mailer = Mail::Mailer->new('smtps', Server => $server);
"Mail::Mailer" will search for executables in the above order. The default mailer will be the first one found.
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::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.
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