.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" 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 >0, 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Mail::Mailer 3pm" .TH Mail::Mailer 3pm "2016-12-27" "perl v5.24.1" "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 . Mail::Field::AddrList by Peter Orbaek . Mail::Mailer and Mail::Send by Tim Bunce . For other contributors see ChangeLog. .SH "LICENSE" .IX Header "LICENSE" Copyrights 1995\-2000 Graham Barr and 2001\-2007 Mark Overmeer . .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