NAME
Mail::Transport - base class for message transmission
CLASS HIERARCHY
Mail::Transport
is a Mail::Reporter
SYNOPSIS
my $message = Mail::Message->new(...);
$message->send;
$message->send(via => 'sendmail');
my $sender = Mail::Transport::SMTP->new(...);
$sender->send($message);
DESCRIPTION
Organize sending of Mail::Message objects to the destinations as specified in the header. The Mail::Transport module is capable to autodetect which of the following modules work on your system:
Mail::Transport::SendmailUse sendmail to process and deliver the mail. This requires the
sendmailprogram to be installed on your system.Mail::Transport::QmailUse
qmail-injectto distribute the message.Mail::Transport::SMTPIn this case, Perl is handling mail transport on its own. This is less desired but more portable than sending with sendmail or qmail.
The advantage is that this sender is environment independent, and easier to configure. However, there is no daemon involved which means that your program will wait until the message is delivered, and the message is lost when your program is interrupted during delivery (which may take hours to complete).
Mail::Transport::MailxUse the external
mail,mailx, orMailprograms to send the message. Usually, the result is poor, because some versions of these programs do not support MIME headers.
METHOD INDEX
The general methods for Mail::Transport objects:
MR errors MR reportAll [LEVEL]
MR log [LEVEL [,STRINGS]] send MESSAGE, OPTIONS
new OPTIONS MR trace [LEVEL]
MR report [LEVEL] trySend MESSAGE, OPTIONS
The extra methods for extension writers:
MR AUTOLOAD MR logPriority LEVEL
MR DESTROY MR logSettings
findBinary NAME [, DIRECTOR... MR notImplemented
MR inGlobalDestruction putContent MESSAGE, FILEHAN...
Prefixed methods are described in MR = Mail::Reporter.
METHODS
- new OPTIONS
-
OPTION DESCRIBED IN DEFAULT log Mail::Reporter 'WARNINGS' trace Mail::Reporter 'WARNINGS' via Mail::Transport 'smtp' proxy Mail::Transport undefproxy => PATH
The name of the proxy software (the mail handler). This must be the name (preferable the absolute path) of your mail delivery software.
via => CLASS|NAME
Which CLASS (extending
Mail::Transport) will transport the data. Some predefined NAMEs avoid long class names:mailandmailxare handled by theMail::Transport::Mailxmodule,sendmailbelongs to::Sendmail, andsmtpis implemented in::SMTP.
- send MESSAGE, OPTIONS
-
Transmit the MESSAGE, which may be anything what can be coerced into a
Mail::Message, so includingMail::InternetandMIME::Entitymessages. It returns true when the transmission was succesfully completed.Some extensions to
Mail::Transportmay offer OPTIONS, but at least the following are supported:OPTIONS DESCRIBED IN DEFAULT interval Mail::Transport 30 retry Mail::Transport undefinterval => SECONDS
Retry to send the message every so many SECONDS, until transmission is successful or the number of retries is reached. The number must be larger than 0.
retry => NUMBER|undef
The number of retries before the sending will fail. If
undef, the number of retries is unlimited.
- trySend MESSAGE, OPTIONS
-
Try to send the message. This will return true if successful, and false in case some problems where detected. The
$?contains the exit status of the command which was started.
METHODS for extension writers
- putContent MESSAGE, FILEHANDLE, OPTIONS
-
Print the content of the MESSAGE to the FILEHANDLE.
OPTIONS DESCRIBED IN DEFAULT body_only Mail::Transport <false> undisclosed Mail::Transport <false>body_only => BOOLEAN
Print only the body of the message, not the whole.
undisclosed => BOOLEAN
Do not print the
BccandResent-Bcclines. Default false, which means that they are printed.
- findBinary NAME [, DIRECTORIES]
-
Look for a binary with the specified NAME in the directories which are defined to be safe. The list of standard directories is followed by the optional DIRECTORIES. The full pathname is returned.
You may specify a
proxyoption, which specifies the absolute name of the binary to be used.
SEE ALSO
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.005.
Copyright (c) 2001 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.