Mail::Mailer - Simple interface to electronic mailing mechanisms
use Mail::Mailer; use Mail::Mailer qw(mail);
$mailer = new Mail::Mailer;
$mailer = new Mail::Mailer $type, @args;
$mailer->open(\%headers);
print $mailer $body;
$mailer->close;
$mailer = new Mail::Mailer '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".
"Mail::Mailer" will search for executables in the above order. The default mailer will be the first one found.
"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']").
Secure all forms of send_headers() against hacker attack and invalid contents. Especially ``\n~...'' in ...::mail::send_headers.
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"
Original code written by Tim Bunce <Tim.Bunce@ig.co.uk>, with a kick start from Graham Barr <gbarr@pobox.com>. With contributions by Gerard Hickey <hickey@ctron.com> Small fix and documentation by Nathan Torkington <gnat@frii.com>.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |