NAME
Mail::Transport::Send - send a message
CLASS INHERITANCE
Mail::Transport::Send is a Mail::Transport is a Mail::Reporter
Mail::Transport::Send is extended by Mail::Transport::Mailx Mail::Transport::Qmail Mail::Transport::SMTP Mail::Transport::Sendmail
SYNOPSIS
my $message = Mail::Message->new(...);
# Some extensions implement sending:
$message->send;
$message->send(via => 'sendmail');
my $sender = Mail::Transport::SMTP->new(...);
$sender->send($message);
DESCRIPTION
Send a message to the destinations as specified in the header. The Mail::Transport::Send
module is capable of autodetecting which of the following modules work on your system; you may simply call send
without via
options to get a message transported.
Mail::Transport::Sendmail
Use sendmail to process and deliver the mail. This requires the
sendmail
program to be installed on your system.Mail::Transport::Qmail
Use
qmail-inject
to distribute the message.Mail::Transport::SMTP
In 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::Mailx
Use the external
mail
,mailx
, orMail
programs to send the message. Usually, the result is poor, because some versions of these programs do not support MIME headers.
METHODS
Initiation
- new OPTIONS
-
OPTION DEFAULT hostname 'localhost' interval 30 log 'WARNINGS' password undef port undef proxy undef retry <false> timeout 120 trace 'WARNINGS' username undef via 'sendmail'
- hostname => HOSTNAME|ARRAY-OF-HOSTNAMES
-
See Mail::Transport::new(hostname)
- interval => SECONDS
-
See Mail::Transport::new(interval)
- log => LEVEL
-
See Mail::Reporter::new(log)
- password => STRING
-
See Mail::Transport::new(password)
- port => INTEGER
-
See Mail::Transport::new(port)
- proxy => PATH
-
See Mail::Transport::new(proxy)
- retry => NUMBER|undef
-
See Mail::Transport::new(retry)
- timeout => SECONDS
-
See Mail::Transport::new(timeout)
- trace => LEVEL
-
See Mail::Reporter::new(trace)
- username => STRING
-
See Mail::Transport::new(username)
- via => CLASS|NAME
-
See Mail::Transport::new(via)
Server Connection
- findBinary NAME [, DIRECTORIES]
-
See Mail::Transport::findBinary()
- remoteHost
-
See Mail::Transport::remoteHost()
- retry
-
See Mail::Transport::retry()
Sending Mail
- putContent MESSAGE, FILEHANDLE, OPTIONS
-
Print the content of the MESSAGE to the FILEHANDLE.
OPTION DEFAULT body_only <false> undisclosed <false>
- send MESSAGE, OPTIONS
-
Transmit the MESSAGE, which may be anything what can be coerced into a Mail::Message, so including Mail::Internet and MIME::Entity messages. It returns true when the transmission was successfully completed.
As OPTIONS, you can specify an
interval
and aretry
count, which will overrule the setting at initiation of the transporter object. - 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.
Logging and Tracing
- defaultTrace [LEVEL, [LEVEL]
-
See Mail::Reporter::defaultTrace()
- errors
-
See Mail::Reporter::errors()
- log [LEVEL [,STRINGS]]
-
See Mail::Reporter::log()
- report [LEVEL]
-
See Mail::Reporter::report()
- reportAll [LEVEL]
-
See Mail::Reporter::reportAll()
- trace [LEVEL]
-
See Mail::Reporter::trace()
- warnings
-
See Mail::Reporter::warnings()
Other Methods
- AUTOLOAD
-
See Mail::Reporter::AUTOLOAD()
- DESTROY
-
See Mail::Reporter::DESTROY()
- inGlobalDestruction
-
See Mail::Reporter::inGlobalDestruction()
- logPriority LEVEL
-
See Mail::Reporter::logPriority()
- logSettings
-
See Mail::Reporter::logSettings()
- notImplemented
-
See Mail::Reporter::notImplemented()
SEE ALSO
A good start to read is Mail::Box-Overview. More documentation and a mailinglist are available from the project's website at http://perl.overmeer.net/mailbox/.
AUTHOR
Mark Overmeer (mark@overmeer.net) with the help of many.
VERSION
This code is beta, version 2.022.
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.