{
    "mode": "perldoc",
    "parameter": "Mail::Transport",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ATransport/json",
    "generated": "2026-06-12T10:41:26Z",
    "synopsis": "my $message = Mail::Message->new(...);\n# Some extensions implement sending:\n$message->send;\n$message->send(via => 'sendmail');\nmy $sender = Mail::Transport::SMTP->new(...);\n$sender->send($message);\n# Some extensions implement receiving:\nmy $receiver = Mail::Transport::POP3->new(...);\n$message = $receiver->receive;",
    "sections": {
        "NAME": {
            "content": "Mail::Transport - use Mail Transfer Agents (MTAs)\n",
            "subsections": []
        },
        "INHERITANCE": {
            "content": "Mail::Transport\nis a Mail::Reporter\n\nMail::Transport is extended by\nMail::Transport::Receive\nMail::Transport::Send\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $message = Mail::Message->new(...);\n\n# Some extensions implement sending:\n$message->send;\n$message->send(via => 'sendmail');\n\nmy $sender = Mail::Transport::SMTP->new(...);\n$sender->send($message);\n\n# Some extensions implement receiving:\nmy $receiver = Mail::Transport::POP3->new(...);\n$message = $receiver->receive;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Objects which extend \"Mail::Transport\" implement sending and/or receiving of messages, using\nvarious protocols.\n\nMail::Transport::Send extends this class, and offers general functionality for send protocols,\nlike SMTP. Mail::Transport::Receive also extends this class, and offers receive method. Some\ntransport protocols will implement both sending and receiving.\n\nExtends \"DESCRIPTION\" in Mail::Reporter.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Extends \"METHODS\" in Mail::Reporter.\n",
            "subsections": [
                {
                    "name": "Constructors",
                    "content": "Extends \"Constructors\" in Mail::Reporter.\n\nMail::Transport->new(%options)\n-Option    --Defined in     --Default\nexecutable                   undef\nhostname                     'localhost'\ninterval                     30\nlog         Mail::Reporter   'WARNINGS'\npassword                     undef\nport                         undef\nproxy                        undef\nretry                        <false>\ntimeout                      120\ntrace       Mail::Reporter   'WARNINGS'\nusername                     undef\nvia                          'sendmail'\n\nexecutable => FILENAME\nIf you specify an executable, the module does not need to search the system directories to\nfigure-out where the client lives. Using this decreases the flexible usage of your\nprogram: moving your program to other systems may involve changing the path to the\nexecutable, which otherwise would work auto-detect and unmodified.\n\nhostname => HOSTNAME|ARRAY\nThe host on which the server runs. Some protocols accept an ARRAY of alternatives for this\noption.\n\ninterval => SECONDS\nThe time between tries to contact the remote server for sending or receiving a message in\nSECONDS. This number must be larger than 0.\n\nlog => LEVEL\npassword => STRING\nSome protocols require a password to be given, usually in combination with a password.\n\nport => INTEGER\nThe port number behind which the service is hiding on the remote server.\n\nproxy => PATH\nThe name of the proxy software (the protocol handler). This must be the name (preferable\nthe absolute path) of your mail delivery software.\n\nretry => NUMBER|undef\nThe number of retries before the sending will fail. If \"undef\", the number of retries is\nunlimited.\n\ntimeout => SECONDS\nSECONDS till time-out while establishing the connection to a remote server.\n\ntrace => LEVEL\nusername => STRING\nSome protocols require a user to login.\n\nvia => CLASS|NAME\nWhich CLASS (extending \"Mail::Transport\") will transport the data. Some predefined NAMEs\navoid long class names: \"mail\" and \"mailx\" are handled by the Mail::Transport::Mailx\nmodule, \"sendmail\" and \"postfix\" belong to Mail::Transport::Sendmail, and \"smtp\" is\nimplemented in Mail::Transport::SMTP.\n\nThe \"pop\" or \"pop3\" protocol implementation can be found distribution\nMail::Transport::POP3. For \"imap\" or \"imap4\", install Mail::Transport::IMAP4.\n"
                },
                {
                    "name": "Server connection",
                    "content": "$obj->findBinary( $name, [@directories] )\nLook for a binary with the specified $name in the directories which are defined to be safe.\nThe list of standard directories is followed by the optional @directories. The full pathname\nis returned.\n\nYou may specify new(proxy), which specifies the absolute name of the binary to be used.\n\n$obj->remoteHost()\nReturns the hostname, port number, username and password to be used to establish the\nconnection to the server for sending or receiving mail.\n\n$obj->retry()\nReturns the retry interval, retry count, and timeout for the connection.\n"
                },
                {
                    "name": "Error handling",
                    "content": "Extends \"Error handling\" in Mail::Reporter.\n\n$obj->AUTOLOAD()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->addReport($object)\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )\nMail::Transport->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->errors()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->log( [$level, [$strings]] )\nMail::Transport->log( [$level, [$strings]] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logPriority($level)\nMail::Transport->logPriority($level)\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logSettings()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->notImplemented()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->report( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->reportAll( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->trace( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->warnings()\nInherited, see \"Error handling\" in Mail::Reporter\n"
                },
                {
                    "name": "Cleanup",
                    "content": "Extends \"Cleanup\" in Mail::Reporter.\n\n$obj->DESTROY()\nInherited, see \"Cleanup\" in Mail::Reporter\n"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "Warning: Avoid program abuse: specify an absolute path for $exec.\nSpecifying explicit locations for executables of email transfer agents should only be done\nwith absolute file names, to avoid various pontential security problems.\n\nWarning: Executable $exec does not exist.\nThe explicitly indicated mail transfer agent does not exists. The normal settings are used\nto find the correct location.\n\nError: Package $package does not implement $method.\nFatal error: the specific package (or one of its superclasses) does not implement this\nmethod where it should. This message means that some other related classes do implement this\nmethod however the class at hand does not. Probably you should investigate this and probably\ninform the author of the package.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "This module is part of Mail-Transport distribution version 3.005, built on July 22, 2020.\nWebsite: http://perl.overmeer.net/CPAN/\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "Copyrights 2001-2020 by [Mark Overmeer]. For other contributors see ChangeLog.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://dev.perl.org/licenses/\n",
            "subsections": []
        }
    },
    "summary": "Mail::Transport - use Mail Transfer Agents (MTAs)",
    "flags": [],
    "examples": [],
    "see_also": []
}