NAME
Mail::Transport::SMTP - transmit messages without external program
CLASS HIERARCHY
Mail::Transport::SMTP
is a Mail::Transport
is a Mail::Reporter
SYNOPSIS
my $sender = Mail::Transport::SMTP->new(...);
$sender->send($message);
$message->send(via => 'smtp');
DESCRIPTION
USE WITH CARE! THIS MODULE IS VERY NEW, SO MAY CONTAIN BUGS
This module implements transport of Mail::Message objects by negotiating to the destination host directly by using the SMTP protocol, without help of sendmail, mail, or other programs on the local host.
METHOD INDEX
Methods prefixed with an abbreviation are described in Mail::Reporter (MR), Mail::Transport (MT).
The general methods for Mail::Transport::SMTP objects:
contactAnyServer MT send MESSAGE, OPTIONS
MR errors MR trace [LEVEL]
MR log [LEVEL [,STRINGS]] tryConnectTo HOST, OPTIONS
new OPTIONS trySend MESSAGE, OPTIONS
MR report [LEVEL] MR warnings
MR reportAll [LEVEL]
The extra methods for extension writers:
MR AUTOLOAD MR logPriority LEVEL
MR DESTROY MR logSettings
MT findBinary NAME [, DIRECTOR... MR notImplemented
MR inGlobalDestruction MT putContent MESSAGE, FILEHAN...
METHODS
- new OPTIONS
-
OPTION DESCRIBED IN DEFAULT debug Mail::Transport::SMTP 0 helo_domain Mail::Transport::SMTP <from Net::Config> log Mail::Reporter 'WARNINGS' proxy Mail::Transport::STMP <from Net::Config> timeout Mail::Transport::SMTP 120 trace Mail::Reporter 'WARNINGS' via Mail::Transport <unused>- debug => BOOLEAN
-
Simulate transmission: the SMTP protocol output will be sent to your screen.
- helo_domain => HOST
-
The fully qualified name of the sender's host (your system) which is used for the greeting message to the receiver. If not specified, Net::Config or else Net::Domain are questioned to find it. When even these do not supply a valid name, the name of the domain in the
Fromline of the message is assumed. - proxy => HOST|ARRAY-OF-HOSTS
-
Specifies the system which is used as relay HOST. By default, the configuration of Net::Config is used. When more than one hostname is specified, the first host which can be contacted will be used.
- timeout => SECONDS
-
The number of seconds to wait for a valid response from the server before failing.
- trySend MESSAGE, OPTIONS
-
Try to send the MESSAGE once. This may fail, in which case this method will return
false. In list context, the reason for failure can be caught: in list contexttrySendwill return a list of five values:(success, error code, error text, error location, quit success)Success and quit success are booleans. The error code and -text are protocol specific codes and texts. The location tells where the problem occurred.
As OPTIONS, you can use
to => ADDRESS|[ADDRESSES]
Alternative destinations. If not specified, the
To,CcandBccfields of the header are used. An address is a string or a Mail::Address object.from => ADDRESS
Your own identification. This may be fake. If not specified, it is taken from the
Fromfield in the header.
- contactAnyServer
-
Creates the connection to the SMTP server. When more than one hostname was specified, the first which accepts a connection is taken. An
IO::Server::INETobject is returned. - tryConnectTo HOST, OPTIONS
-
Try to establish a connection to deliver SMTP to the specified HOST. The OPTIONS are passed to the
newmethod of Net::SMTP.
SEE ALSO
For support and additional documentation, see http://perl.overmeer.net/mailbox/
AUTHOR
Mark Overmeer (mailbox@overmeer.net). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
VERSION
This code is beta, version 2.017.
Copyright (c) 2001-2002 Mark Overmeer. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.