1Mail::Mailer(3)       User Contributed Perl Documentation      Mail::Mailer(3)
2
3
4

NAME

6       Mail::Mailer - send simple emails
7

INHERITANCE

9        Mail::Mailer
10          is an IO::Handle
11

SYNOPSIS

13         use Mail::Mailer;
14         use Mail::Mailer qw(mail);    # specifies default mailer
15
16         $mailer = Mail::Mailer->new;
17         $mailer = Mail::Mailer->new($type, @args);
18
19         $mailer->open(\%headers);
20         print $mailer $body;
21         $mailer->close
22             or die "couldn't send whole message: $!\n";
23

DESCRIPTION

25       Sends mail using any of the built-in methods.  As TYPE argument to
26       new(), you can specify any of
27
28       "sendmail"
29           Use the "sendmail" program to deliver the mail.
30
31       "smtp"
32           Use the "smtp" protocol via Net::SMTP to deliver the mail. The
33           server to use can be specified in @args with
34
35            $mailer = Mail::Mailer->new('smtp', Server => $server);
36
37           The smtp mailer does not handle "Cc" and "Bcc" lines, neither their
38           "Resent-*" fellows. The "Debug" options enables debugging output
39           from "Net::SMTP".
40
41           [added 2.21] You may also use the "StartTLS => 1" options to
42           upgrade the connection with STARTTLS.  You need "libnet" version
43           1.28 (2014) for this to work.
44
45           You may also use the "Auth => [ $user, $password ]" option for SASL
46           authentication. To make this work, you have to install the
47           Authen::SASL distribution yourself: it is not automatically
48           installed.
49
50       "smtps"
51           This option is deprecated when you have "libnet" 1.28 (2014) and
52           above.
53
54           Use the smtp over ssl protocol via Net::SMTP::SSL to deliver the
55           mail.  Usage is identical to "smtp". You have to install
56           Authen::SASL as well.
57
58            $mailer = Mail::Mailer->new('smtps', Server => $server);
59
60       "qmail"
61           Use qmail's qmail-inject program to deliver the mail.
62
63       "testfile"
64           Used for debugging, this displays the data to the file named in
65           $Mail::Mailer::testfile::config{outfile} which defaults to a file
66           named "mailer.testfile".  No mail is ever sent.
67
68       "Mail::Mailer" will search for executables in the above order. The
69       default mailer will be the first one found.
70

METHODS

72   Constructors
73       Mail::Mailer->new($type, %options)
74           The $type is one of the back-end sender implementations, as
75           described in the DESCRIPTION chapter of this manual page.  The
76           %options are passed to that back-end.
77
78       $obj->open(HASH)
79           The HASH consists of key and value pairs, the key being the name of
80           the header field (eg, "To"), and the value being the corresponding
81           contents of the header field.  The value can either be a scalar
82           (eg, "gnat@frii.com") or a reference to an array of scalars ("eg,
83           ['gnat@frii.com', 'Tim.Bunce@ig.co.uk']").
84

DETAILS

86   ENVIRONMENT VARIABLES
87       PERL_MAILERS
88           Augments/override the build in choice for binary used to send out
89           our mail messages.
90
91           Format:
92
93               "type1:mailbinary1;mailbinary2;...:type2:mailbinaryX;...:..."
94
95           Example: assume you want you use private sendmail binary instead of
96           mailx, one could set "PERL_MAILERS" to:
97
98               "mail:/does/not/exists:sendmail:$HOME/test/bin/sendmail"
99
100           On systems which may include ":" in file names, use "|" as
101           separator between type-groups.
102
103               "mail:c:/does/not/exists|sendmail:$HOME/test/bin/sendmail"
104
105   BUGS
106       Mail::Mailer does not help with folding, and does not protect against
107       various web-script hacker attacks, for instance where a new-line is
108       inserted in the content of the field.
109

SEE ALSO

111       This module is part of the MailTools distribution,
112       http://perl.overmeer.net/mailtools/.
113

AUTHORS

115       The MailTools bundle was developed by Graham Barr.  Later, Mark
116       Overmeer took over maintenance without commitment to further
117       development.
118
119       Mail::Cap by Gisle Aas <aas@oslonett.no>.  Mail::Field::AddrList by
120       Peter Orbaek <poe@cit.dk>.  Mail::Mailer and Mail::Send by Tim Bunce
121       <Tim.Bunce@ig.co.uk>.  For other contributors see ChangeLog.
122

LICENSE

124       Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2017 Mark
125       Overmeer <perl@overmeer.net>.
126
127       This program is free software; you can redistribute it and/or modify it
128       under the same terms as Perl itself.  See
129       http://www.perl.com/perl/misc/Artistic.html
130
131
132
133perl v5.34.0                      2022-01-21                   Mail::Mailer(3)
Impressum