1Mail::Transport::Send(3U)ser Contributed Perl DocumentatiMoanil::Transport::Send(3)
2
3
4

NAME

6       Mail::Transport::Send - send a message
7

INHERITANCE

9        Mail::Transport::Send
10          is a Mail::Transport
11          is a Mail::Reporter
12
13        Mail::Transport::Send is extended by
14          Mail::Transport::Exim
15          Mail::Transport::Mailx
16          Mail::Transport::Qmail
17          Mail::Transport::SMTP
18          Mail::Transport::Sendmail
19

SYNOPSIS

21        my $message = Mail::Message->new(...);
22
23        # Some extensions implement sending:
24        $message->send;
25        $message->send(via => 'sendmail');
26
27        my $sender = Mail::Transport::SMTP->new(...);
28        $sender->send($message);
29

DESCRIPTION

31       Send a message to the destinations as specified in the header.  The
32       "Mail::Transport::Send" module is capable of autodetecting which of the
33       following modules work on your system; you may simply call "send" with‐
34       out "via" options to get a message transported.
35
36       * Mail::Transport::Sendmail
37           Use sendmail to process and deliver the mail.  This requires the
38           "sendmail" program to be installed on your system.  Whether this is
39           an original sendmail, or a replacement from Postfix does matter.
40
41       * Mail::Transport::Exim
42           Use "exim" to distribute the message.
43
44       * Mail::Transport::Qmail
45           Use "qmail-inject" to distribute the message.
46
47       * Mail::Transport::SMTP
48           In this case, Perl is handling mail transport on its own.  This is
49           less desired but more portable than sending with sendmail or qmail.
50           The advantage is that this sender is environment independent, and
51           easier to configure.  However, there is no daemon involved which
52           means that your program will wait until the message is delivered,
53           and the message is lost when your program is interrupted during
54           delivery (which may take hours to complete).
55
56       * Mail::Transport::Mailx
57           Use the external "mail", "mailx", or "Mail" programs to send the
58           message.  Usually, the result is poor, because some versions of
59           these programs do not support MIME headers.  Besides, these pro‐
60           grams are known to have exploitable security breaches.
61

METHODS

63       Constructors
64
65       Mail::Transport::Send->new(OPTIONS)
66
67        Option    --Defined in     --Default
68        executable  Mail::Transport  undef
69        hostname    Mail::Transport  'localhost'
70        interval    Mail::Transport  30
71        log         Mail::Reporter   'WARNINGS'
72        password    Mail::Transport  undef
73        port        Mail::Transport  undef
74        proxy       Mail::Transport  undef
75        retry       Mail::Transport  <false>
76        timeout     Mail::Transport  120
77        trace       Mail::Reporter   'WARNINGS'
78        username    Mail::Transport  undef
79        via         Mail::Transport  'sendmail'
80
81           . executable FILENAME
82
83           . hostname HOSTNAME⎪ARRAY-OF-HOSTNAMES
84
85           . interval SECONDS
86
87           . log LEVEL
88
89           . password STRING
90
91           . port INTEGER
92
93           . proxy PATH
94
95           . retry NUMBER⎪undef
96
97           . timeout SECONDS
98
99           . trace LEVEL
100
101           . username STRING
102
103           . via CLASS⎪NAME
104
105       Sending mail
106
107       $obj->destinations(MESSAGE, [ADDRESS⎪ARRAY-OF-ADDRESSES])
108
109           Determine the destination for this message.  If a valid ADDRESS is
110           defined, this is used to overrule the addresses within the message.
111           If the ADDRESS is "undef" it is ignored.
112
113           If no ADDRESS is specified, the message is scanned for resent
114           groups (see Mail::Message::Head::Complete::resentGroups()).  The
115           addresses found in the first (is latest added) group are used.  If
116           no resent groups are found, the normal "To", "Cc", and "Bcc" lines
117           are taken.
118
119       $obj->putContent(MESSAGE, FILEHANDLE, OPTIONS)
120
121           Print the content of the MESSAGE to the FILEHANDLE.
122
123            Option     --Default
124            body_only    <false>
125            undisclosed  <false>
126
127           . body_only BOOLEAN
128
129               Print only the body of the message, not the whole.
130
131           . undisclosed BOOLEAN
132
133               Do not print the "Bcc" and "Resent-Bcc" lines.  Default false,
134               which means that they are not printed.
135
136       $obj->send(MESSAGE, OPTIONS)
137
138           Transmit the MESSAGE, which may be anything what can be coerced
139           into a Mail::Message, so including Mail::Internet and MIME::Entity
140           messages.  It returns true when the transmission was successfully
141           completed.
142
143            Option  --Default
144            interval  new(interval)
145            retry     new(retry)
146            to        undef
147
148           . interval SECONDS
149
150           . retry INTEGER
151
152           . to STRING
153
154               Overrules the destination(s) of the message, which is by
155               default taken from the (Resent-)To, (Resent-)Cc, and
156               (Resent-)Bcc.
157
158       $obj->trySend(MESSAGE, OPTIONS)
159
160           Try to send the message. This will return true if successful, and
161           false in case some problems where detected.  The $? contains the
162           exit status of the command which was started.
163
164       Server connection
165
166       $obj->findBinary(NAME [, DIRECTORIES])
167
168           See "Server connection" in Mail::Transport
169
170       $obj->remoteHost
171
172           See "Server connection" in Mail::Transport
173
174       $obj->retry
175
176           See "Server connection" in Mail::Transport
177
178       Error handling
179
180       $obj->AUTOLOAD
181
182           See "Error handling" in Mail::Reporter
183
184       $obj->addReport(OBJECT)
185
186           See "Error handling" in Mail::Reporter
187
188       $obj->defaultTrace([LEVEL]⎪[LOGLEVEL, TRACELEVEL]⎪[LEVEL, CALLBACK])
189
190       Mail::Transport::Send->defaultTrace([LEVEL]⎪[LOGLEVEL,
191       TRACELEVEL]⎪[LEVEL, CALLBACK])
192
193           See "Error handling" in Mail::Reporter
194
195       $obj->errors
196
197           See "Error handling" in Mail::Reporter
198
199       $obj->log([LEVEL [,STRINGS]])
200
201       Mail::Transport::Send->log([LEVEL [,STRINGS]])
202
203           See "Error handling" in Mail::Reporter
204
205       $obj->logPriority(LEVEL)
206
207       Mail::Transport::Send->logPriority(LEVEL)
208
209           See "Error handling" in Mail::Reporter
210
211       $obj->logSettings
212
213           See "Error handling" in Mail::Reporter
214
215       $obj->notImplemented
216
217           See "Error handling" in Mail::Reporter
218
219       $obj->report([LEVEL])
220
221           See "Error handling" in Mail::Reporter
222
223       $obj->reportAll([LEVEL])
224
225           See "Error handling" in Mail::Reporter
226
227       $obj->trace([LEVEL])
228
229           See "Error handling" in Mail::Reporter
230
231       $obj->warnings
232
233           See "Error handling" in Mail::Reporter
234
235       Cleanup
236
237       $obj->DESTROY
238
239           See "Cleanup" in Mail::Reporter
240
241       $obj->inGlobalDestruction
242
243           See "Cleanup" in Mail::Reporter
244

DIAGNOSTICS

246       Warning: Message has no destination
247
248       It was not possible to figure-out where the message is intended to go
249       to.
250
251       Error: Package $package does not implement $method.
252
253       Fatal error: the specific package (or one of its superclasses) does not
254       implement this method where it should. This message means that some
255       other related classes do implement this method however the class at
256       hand does not.  Probably you should investigate this and probably
257       inform the author of the package.
258
259       Warning: Resent group does not specify a destination
260
261       The message which is sent is the result of a bounce (for instance cre‐
262       ated with Mail::Message::bounce()), and therefore starts with a
263       "Received" header field.  With the "bounce", the new destination(s) of
264       the message are given, which should be included as "Resent-To",
265       "Resent-Cc", and "Resent-Bcc".
266
267       The "To", "Cc", and "Bcc" header information is only used if no
268       "Received" was found.  That seems to be the best explanation of the
269       RFC.
270
271       As alternative, you may also specify the "to" option to some of the
272       senders (for instance Mail::Transport::SMTP::send(to) to overrule any
273       information found in the message itself about the destination.
274
275       Error: Transporters of type $class cannot send.
276
277       The Mail::Transport object of the specified type can not send messages,
278       but only receive message.
279

SEE ALSO

281       This module is part of Mail-Box distribution version 2.070, built on
282       March 25, 2007. Website: http://perl.overmeer.net/mailbox/
283

LICENSE

285       Copyrights 2001-2007 by Mark Overmeer.For other contributors see
286       ChangeLog.
287
288       This program is free software; you can redistribute it and/or modify it
289       under the same terms as Perl itself.  See
290       http://www.perl.com/perl/misc/Artistic.html
291
292
293
294perl v5.8.8                       2007-03-25          Mail::Transport::Send(3)
Impressum