
=head1 NAME


Mail::Transport - base class for message exchange

=head1 CLASS INHERITANCE

Mail::Transport
   is a Mail::Reporter

Mail::Transport is extended by
   Mail::Transport::Receive
   Mail::Transport::Send

=head1 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);

 # Some extensions implement receiving:
 my $receiver = Mail::Transport::POP3->new(...);
 $message = $receiver->receive;

=head1 DESCRIPTION


Objects which extend Mail::Transport implement sending and/or
receiving of messages, using various protocols.

Mail::Transport::Send extends this class, and offers general
functionality for send protocols, like SMTP.  Mail::Transport::Receive
also extends this class, and offers receive method.  Some transport
protocols will implement both sending and receiving.

=head1 METHODS

=head2 Initiation

=over 4

=item B<new> OPTIONS X<new>

 OPTION               DEFAULT
 hostname             'localhost'
 interval             30
 log                  'WARNINGS'
 password             undef
 port                 undef
 proxy                undef
 retry                <false>
 timeout              120
 trace                'WARNINGS'
 username             undef
 via                  'sendmail'

=over 4

=item B<hostname> =E<gt> HOSTNAME|ARRAY-OF-HOSTNAMES X<new(hostname)>

The host on which the server runs.  Some protocols accept an array
of alternatives for this option.

=item B<interval> =E<gt> SECONDS X<new(interval)>

The time between tries to contact the remote server for sending or
receiving a message in SECONDS.  This number must be larger than 0.

=item B<log> =E<gt> LEVEL

See Mail::Reporter::new(log)

=item B<password> =E<gt> STRING X<new(password)>

Some protocols require a password to be given, usually in combination
with a password.

=item B<port> =E<gt> INTEGER X<new(port)>

The port number behind which the service is hiding on the remote server.

=item B<proxy> =E<gt> PATH X<new(proxy)>

The name of the proxy software (the mail handler).  This must be
the name (preferable the absolute path) of your mail delivery
software.

=item B<retry> =E<gt> NUMBER|undef X<new(retry)>

The number of retries before the sending will fail.  If C<undef>, the
number of retries is unlimited.

=item B<timeout> =E<gt> SECONDS X<new(timeout)>

SECONDS till time-out while establishing the connection to a remote server.

=item B<trace> =E<gt> LEVEL

See Mail::Reporter::new(trace)

=item B<username> =E<gt> STRING X<new(username)>

Some protocols require a user to login.

=item B<via> =E<gt> CLASS|NAME X<new(via)>

Which CLASS (extending Mail::Transport) will transport the data.  Some
predefined NAMEs avoid long class names: C<mail> and C<mailx> are handled
by the Mail::Transport::Mailx module, C<sendmail> belongs to
C<::Sendmail>, and C<smtp> is implemented in C<::SMTP>.  The C<pop> or
C<pop3> protocol implementation can be found in C<::POP3>.

=back

=back

=head2 Server Connection

=over 4

=item B<findBinary> NAME [, DIRECTORIES] X<findBinary>

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 C<proxy> option, which specifies the absolute name
of the binary to be used.

=item B<remoteHost>  X<remoteHost>

Returns the hostname, port number, username and password to be used to
establish the connection to the server for sending or receiving mail.

=item B<retry>  X<retry>

Returns the retry interval, retry count, and timeout for the connection.

=back

=head2 Logging and Tracing

=over 4

=item B<errors> 

See Mail::Reporter::errors()

=item B<log> [LEVEL [,STRINGS]]

See Mail::Reporter::log()

=item B<report> [LEVEL]

See Mail::Reporter::report()

=item B<reportAll> [LEVEL]

See Mail::Reporter::reportAll()

=item B<trace> [LEVEL]

See Mail::Reporter::trace()

=item B<warnings> 

See Mail::Reporter::warnings()

=back

=head2 Other Methods

=over 4

=item B<AUTOLOAD> 

See Mail::Reporter::AUTOLOAD()

=item B<DESTROY> 

See Mail::Reporter::DESTROY()

=item B<inGlobalDestruction> 

See Mail::Reporter::inGlobalDestruction()

=item B<logPriority> LEVEL

See Mail::Reporter::logPriority()

=item B<logSettings> 

See Mail::Reporter::logSettings()

=item B<notImplemented> 

See Mail::Reporter::notImplemented()

=back

=head1 SEE ALSO

A good start to read is Mail::Box-Overview.
More documentation and a mailinglist are available from the project's
website at L<http://perl.overmeer.net/mailbox/>.

=head1 AUTHOR

Mark Overmeer (L<mark@overmeer.net|mailto:mark@overmeer.net>) with the help of many.

=head1 VERSION

This code is beta, version 2.019.

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.
