1Mail::Transport(3) User Contributed Perl Documentation Mail::Transport(3)
2
3
4
6 Mail::Transport - use Mail Transfer Agents (MTAs)
7
9 Mail::Transport
10 is a Mail::Reporter
11
12 Mail::Transport is extended by
13 Mail::Transport::Receive
14 Mail::Transport::Send
15
17 my $message = Mail::Message->new(...);
18
19 # Some extensions implement sending:
20 $message->send;
21 $message->send(via => 'sendmail');
22
23 my $sender = Mail::Transport::SMTP->new(...);
24 $sender->send($message);
25
26 # Some extensions implement receiving:
27 my $receiver = Mail::Transport::POP3->new(...);
28 $message = $receiver->receive;
29
31 Objects which extend "Mail::Transport" implement sending and/or
32 receiving of messages, using various protocols.
33
34 Mail::Transport::Send extends this class, and offers general
35 functionality for send protocols, like SMTP. Mail::Transport::Receive
36 also extends this class, and offers receive method. Some transport
37 protocols will implement both sending and receiving.
38
39 Extends "DESCRIPTION" in Mail::Reporter.
40
42 Extends "METHODS" in Mail::Reporter.
43
44 Constructors
45 Extends "Constructors" in Mail::Reporter.
46
47 Mail::Transport->new(%options)
48 -Option --Defined in --Default
49 executable undef
50 hostname 'localhost'
51 interval 30
52 log Mail::Reporter 'WARNINGS'
53 password undef
54 port undef
55 proxy undef
56 retry <false>
57 timeout 120
58 trace Mail::Reporter 'WARNINGS'
59 username undef
60 via 'sendmail'
61
62 executable => FILENAME
63 If you specify an executable, the module does not need to search
64 the system directories to figure-out where the client lives.
65 Using this decreases the flexible usage of your program: moving
66 your program to other systems may involve changing the path to
67 the executable, which otherwise would work auto-detect and
68 unmodified.
69
70 hostname => HOSTNAME|ARRAY
71 The host on which the server runs. Some protocols accept an
72 ARRAY of alternatives for this option.
73
74 interval => SECONDS
75 The time between tries to contact the remote server for sending
76 or receiving a message in SECONDS. This number must be larger
77 than 0.
78
79 log => LEVEL
80 password => STRING
81 Some protocols require a password to be given, usually in
82 combination with a password.
83
84 port => INTEGER
85 The port number behind which the service is hiding on the remote
86 server.
87
88 proxy => PATH
89 The name of the proxy software (the protocol handler). This must
90 be the name (preferable the absolute path) of your mail delivery
91 software.
92
93 retry => NUMBER|undef
94 The number of retries before the sending will fail. If "undef",
95 the number of retries is unlimited.
96
97 timeout => SECONDS
98 SECONDS till time-out while establishing the connection to a
99 remote server.
100
101 trace => LEVEL
102 username => STRING
103 Some protocols require a user to login.
104
105 via => CLASS|NAME
106 Which CLASS (extending "Mail::Transport") will transport the
107 data. Some predefined NAMEs avoid long class names: "mail" and
108 "mailx" are handled by the Mail::Transport::Mailx module,
109 "sendmail" and "postfix" belong to Mail::Transport::Sendmail, and
110 "smtp" is implemented in Mail::Transport::SMTP. The "pop" or
111 "pop3" protocol implementation can be found in
112 Mail::Transport::POP3.
113
114 Server connection
115 $obj->findBinary( $name, [@directories] )
116 Look for a binary with the specified $name in the directories which
117 are defined to be safe. The list of standard directories is
118 followed by the optional @directories. The full pathname is
119 returned.
120
121 You may specify new(proxy), which specifies the absolute name of
122 the binary to be used.
123
124 $obj->remoteHost()
125 Returns the hostname, port number, username and password to be used
126 to establish the connection to the server for sending or receiving
127 mail.
128
129 $obj->retry()
130 Returns the retry interval, retry count, and timeout for the
131 connection.
132
133 Error handling
134 Extends "Error handling" in Mail::Reporter.
135
136 $obj->AUTOLOAD()
137 Inherited, see "Error handling" in Mail::Reporter
138
139 $obj->addReport($object)
140 Inherited, see "Error handling" in Mail::Reporter
141
142 $obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level,
143 $callback] )
144 Mail::Transport->defaultTrace( [$level]|[$loglevel,
145 $tracelevel]|[$level, $callback] )
146 Inherited, see "Error handling" in Mail::Reporter
147
148 $obj->errors()
149 Inherited, see "Error handling" in Mail::Reporter
150
151 $obj->log( [$level, [$strings]] )
152 Mail::Transport->log( [$level, [$strings]] )
153 Inherited, see "Error handling" in Mail::Reporter
154
155 $obj->logPriority($level)
156 Mail::Transport->logPriority($level)
157 Inherited, see "Error handling" in Mail::Reporter
158
159 $obj->logSettings()
160 Inherited, see "Error handling" in Mail::Reporter
161
162 $obj->notImplemented()
163 Inherited, see "Error handling" in Mail::Reporter
164
165 $obj->report( [$level] )
166 Inherited, see "Error handling" in Mail::Reporter
167
168 $obj->reportAll( [$level] )
169 Inherited, see "Error handling" in Mail::Reporter
170
171 $obj->trace( [$level] )
172 Inherited, see "Error handling" in Mail::Reporter
173
174 $obj->warnings()
175 Inherited, see "Error handling" in Mail::Reporter
176
177 Cleanup
178 Extends "Cleanup" in Mail::Reporter.
179
180 $obj->DESTROY()
181 Inherited, see "Cleanup" in Mail::Reporter
182
184 Warning: Avoid program abuse: specify an absolute path for $exec.
185 Specifying explicit locations for executables of email transfer
186 agents should only be done with absolute file names, to avoid
187 various pontential security problems.
188
189 Warning: Executable $exec does not exist.
190 The explicitly indicated mail transfer agent does not exists. The
191 normal settings are used to find the correct location.
192
193 Error: Package $package does not implement $method.
194 Fatal error: the specific package (or one of its superclasses) does
195 not implement this method where it should. This message means that
196 some other related classes do implement this method however the
197 class at hand does not. Probably you should investigate this and
198 probably inform the author of the package.
199
201 This module is part of Mail-Transport distribution version 3.003, built
202 on September 03, 2018. Website: http://perl.overmeer.net/CPAN/
203
205 Copyrights 2001-2018 by [Mark Overmeer]. For other contributors see
206 ChangeLog.
207
208 This program is free software; you can redistribute it and/or modify it
209 under the same terms as Perl itself. See http://dev.perl.org/licenses/
210
211
212
213perl v5.28.1 2018-09-03 Mail::Transport(3)