| Current File : //usr/local/share/man/man3/Mail::Mailer.3 |
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
. if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Mail::Mailer 3"
.TH Mail::Mailer 3 "2014-11-22" "perl v5.20.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Mail::Mailer \- Simple interface to electronic mailing mechanisms
.SH "INHERITANCE"
.IX Header "INHERITANCE"
.Vb 2
\& Mail::Mailer
\& is a IO::Handle
.Ve
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\& use Mail::Mailer;
\& use Mail::Mailer qw(mail); # specifies default mailer
\&
\& $mailer = Mail::Mailer\->new;
\& $mailer = Mail::Mailer\->new($type, @args);
\&
\& $mailer\->open(\e%headers);
\& print $mailer $body;
\& $mailer\->close
\& or die "couldn\*(Aqt send whole message: $!\en";
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Sends mail using any of the built-in methods. As \s-1TYPE\s0 argument
to \fInew()\fR, you can specify any of
.ie n .IP """sendmail""" 4
.el .IP "\f(CWsendmail\fR" 4
.IX Item "sendmail"
Use the \f(CW\*(C`sendmail\*(C'\fR program to deliver the mail.
.ie n .IP """smtp""" 4
.el .IP "\f(CWsmtp\fR" 4
.IX Item "smtp"
Use the \f(CW\*(C`smtp\*(C'\fR protocol via Net::SMTP to deliver the mail. The server
to use can be specified in \f(CW@args\fR with
.Sp
.Vb 1
\& $mailer = Mail::Mailer\->new(\*(Aqsmtp\*(Aq, Server => $server);
.Ve
.Sp
The smtp mailer does not handle \f(CW\*(C`Cc\*(C'\fR and \f(CW\*(C`Bcc\*(C'\fR lines, neither their
\&\f(CW\*(C`Resent\-*\*(C'\fR fellows. The \f(CW\*(C`Debug\*(C'\fR options enables debugging output
from \f(CW\*(C`Net::SMTP\*(C'\fR.
.Sp
You may also use the \f(CW\*(C`Auth => [ $user, $password ]\*(C'\fR option for \s-1SASL\s0
authentication. To make this work, you have to install the Authen::SASL
distribution yourself: it is not automatically installed.
.ie n .IP """smtps""" 4
.el .IP "\f(CWsmtps\fR" 4
.IX Item "smtps"
Use the smtp over ssl protocol via Net::SMTP::SSL to deliver the mail.
Usage is identical to \f(CW\*(C`smtp\*(C'\fR. You have to install Authen::SASL as
well.
.Sp
.Vb 1
\& $mailer = Mail::Mailer\->new(\*(Aqsmtps\*(Aq, Server => $server);
.Ve
.ie n .IP """qmail""" 4
.el .IP "\f(CWqmail\fR" 4
.IX Item "qmail"
Use qmail's qmail-inject program to deliver the mail.
.ie n .IP """testfile""" 4
.el .IP "\f(CWtestfile\fR" 4
.IX Item "testfile"
Used for debugging, this displays the data to the file named in
\&\f(CW$Mail::Mailer::testfile::config{outfile}\fR which defaults to a file
named \f(CW\*(C`mailer.testfile\*(C'\fR. No mail is ever sent.
.PP
\&\f(CW\*(C`Mail::Mailer\*(C'\fR will search for executables in the above order. The
default mailer will be the first one found.
.SH "METHODS"
.IX Header "METHODS"
.SS "Constructors"
.IX Subsection "Constructors"
.IP "Mail::Mailer\->\fBnew\fR(\s-1TYPE, ARGS\s0)" 4
.IX Item "Mail::Mailer->new(TYPE, ARGS)"
The \s-1TYPE\s0 is one of the back-end sender implementations, as described in
the \s-1DESCRIPTION\s0 chapter of this manual page. The \s-1ARGS\s0 are passed to
that back-end.
.ie n .IP "$obj\->\fBopen\fR(\s-1HASH\s0)" 4
.el .IP "\f(CW$obj\fR\->\fBopen\fR(\s-1HASH\s0)" 4
.IX Item "$obj->open(HASH)"
The \s-1HASH\s0 consists of key and value pairs, the key being the name of
the header field (eg, \f(CW\*(C`To\*(C'\fR), and the value being the corresponding
contents of the header field. The value can either be a scalar
(eg, \f(CW\*(C`gnat@frii.com\*(C'\fR) or a reference to an array of scalars
(\f(CW\*(C`eg, [\*(Aqgnat@frii.com\*(Aq, \*(AqTim.Bunce@ig.co.uk\*(Aq]\*(C'\fR).
.SH "DETAILS"
.IX Header "DETAILS"
.SS "\s-1ENVIRONMENT VARIABLES\s0"
.IX Subsection "ENVIRONMENT VARIABLES"
.IP "\s-1PERL_MAILERS\s0" 4
.IX Item "PERL_MAILERS"
Augments/override the build in choice for binary used to send out
our mail messages.
.Sp
Format:
.Sp
.Vb 1
\& "type1:mailbinary1;mailbinary2;...:type2:mailbinaryX;...:..."
.Ve
.Sp
Example: assume you want you use private sendmail binary instead
of mailx, one could set \f(CW\*(C`PERL_MAILERS\*(C'\fR to:
.Sp
.Vb 1
\& "mail:/does/not/exists:sendmail:$HOME/test/bin/sendmail"
.Ve
.Sp
On systems which may include \f(CW\*(C`:\*(C'\fR in file names, use \f(CW\*(C`|\*(C'\fR as separator
between type-groups.
.Sp
.Vb 1
\& "mail:c:/does/not/exists|sendmail:$HOME/test/bin/sendmail"
.Ve
.SS "\s-1BUGS\s0"
.IX Subsection "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.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
This module is part of the MailTools distribution,
\&\fIhttp://perl.overmeer.net/mailtools/\fR.
.SH "AUTHORS"
.IX Header "AUTHORS"
The MailTools bundle was developed by Graham Barr. Later, Mark
Overmeer took over maintenance without commitment to further development.
.PP
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.
.SH "LICENSE"
.IX Header "LICENSE"
Copyrights 1995\-2000 Graham Barr <gbarr@pobox.com> and
2001\-2007 Mark Overmeer <perl@overmeer.net>.
.PP
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See \fIhttp://www.perl.com/perl/misc/Artistic.html\fR