The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mail::Transport - base class for message exchange

CLASS HIERARCHY

 Mail::Transport
 is a Mail::Reporter

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;

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.

METHOD INDEX

Methods prefixed with an abbreviation are described in Mail::Reporter (MR).

The general methods for Mail::Transport objects:

   MR errors                            MR reportAll [LEVEL]
   MR log [LEVEL [,STRINGS]]            MR trace [LEVEL]
      new OPTIONS                       MR warnings
   MR report [LEVEL]

The extra methods for extension writers:

   MR AUTOLOAD                          MR logSettings
   MR DESTROY                           MR notImplemented
      findBinary NAME [, DIRECTOR...       remoteHost
   MR inGlobalDestruction                  retry
   MR logPriority LEVEL

METHODS

new OPTIONS
 OPTION            DESCRIBED IN       DEFAULT
 hostname          Mail::Transport    'localhost'
 interval          Mail::Transport    30
 log               Mail::Reporter     'WARNINGS'
 password          Mail::Transport    undef
 port              Mail::Transport    undef
 proxy             Mail::Transport    undef
 retry             Mail::Transport    0
 timeout           Mail::Transport    120
 trace             Mail::Reporter     'WARNINGS'
 username          Mail::Transport    undef
 via               Mail::Transport    'sendmail'
  • hostname => HOSTNAME|ARRAY-OF-HOSTNAMES

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

  • interval => SECONDS

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

  • password => STRING

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

  • proxy => PATH

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

  • port -> INTEGER

    The portnumber behind which the service is hiding on the remote server.

  • retry => NUMBER|undef

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

  • timeout => SECONDS

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

  • username => STRING

    Some protocols require a user to login.

  • via => CLASS|NAME

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

METHODS for extension writers

remoteHost

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

retry

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

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

SEE ALSO

Mail::Box-Overview

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.018.

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.