{
    "mode": "perldoc",
    "parameter": "Mail::Transport::Send",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ATransport%3A%3ASend/json",
    "generated": "2026-06-15T14:44:20Z",
    "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);",
    "sections": {
        "NAME": {
            "content": "Mail::Transport::Send - send a message\n",
            "subsections": []
        },
        "INHERITANCE": {
            "content": "Mail::Transport::Send\nis a Mail::Transport\nis a Mail::Reporter\n\nMail::Transport::Send is extended by\nMail::Transport::Exim\nMail::Transport::Mailx\nMail::Transport::Qmail\nMail::Transport::SMTP\nMail::Transport::Sendmail\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",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Send a message to the destinations as specified in the header. The \"Mail::Transport::Send\"\nmodule is capable of autodetecting which of the following modules work on your system; you may\nsimply call \"send\" without \"via\" options to get a message transported.\n\n*   Mail::Transport::Sendmail\n\nUse sendmail to process and deliver the mail. This requires the \"sendmail\" program to be\ninstalled on your system. Whether this is an original sendmail, or a replacement from\nPostfix does matter.\n\n*   Mail::Transport::Exim\n\nUse \"exim\" to distribute the message.\n\n*   Mail::Transport::Qmail\n\nUse \"qmail-inject\" to distribute the message.\n\n*   Mail::Transport::SMTP\n\nIn this case, Perl is handling mail transport on its own. This is less desired but more\nportable than sending with sendmail or qmail. The advantage is that this sender is\nenvironment independent, and easier to configure. However, there is no daemon involved which\nmeans that your program will wait until the message is delivered, and the message is lost\nwhen your program is interrupted during delivery (which may take hours to complete).\n\n*   Mail::Transport::Mailx\n\nUse the external \"mail\", \"mailx\", or \"Mail\" programs to send the message. Usually, the\nresult is poor, because some versions of these programs do not support MIME headers.\nBesides, these programs are known to have exploitable security breaches.\n\nExtends \"DESCRIPTION\" in Mail::Transport.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Extends \"METHODS\" in Mail::Transport.\n",
            "subsections": [
                {
                    "name": "Constructors",
                    "content": "Extends \"Constructors\" in Mail::Transport.\n\nMail::Transport::Send->new(%options)\n-Option    --Defined in     --Default\nexecutable  Mail::Transport  undef\nhostname    Mail::Transport  'localhost'\ninterval    Mail::Transport  30\nlog         Mail::Reporter   'WARNINGS'\npassword    Mail::Transport  undef\nport        Mail::Transport  undef\nproxy       Mail::Transport  undef\nretry       Mail::Transport  <false>\ntimeout     Mail::Transport  120\ntrace       Mail::Reporter   'WARNINGS'\nusername    Mail::Transport  undef\nvia         Mail::Transport  'sendmail'\n\nexecutable => FILENAME\nhostname => HOSTNAME|ARRAY\ninterval => SECONDS\nlog => LEVEL\npassword => STRING\nport => INTEGER\nproxy => PATH\nretry => NUMBER|undef\ntimeout => SECONDS\ntrace => LEVEL\nusername => STRING\nvia => CLASS|NAME\n"
                },
                {
                    "name": "Sending mail",
                    "content": "$obj->destinations( $message, [$address|ARRAY] )\nDetermine the destination for this message. If a valid $address is defined, this is used to\noverrule the addresses within the message. If the $address is \"undef\" it is ignored. It may\nalso be an ARRAY of addresses.\n\nIf no $address is specified, the message is scanned for resent groups (see\nMail::Message::Head::Complete::resentGroups()). The addresses found in the first (is latest\nadded) group are used. If no resent groups are found, the normal \"To\", \"Cc\", and \"Bcc\" lines\nare taken.\n\n$obj->putContent($message, $fh, %options)\nPrint the content of the $message to the $fh.\n\n-Option     --Default\nbodyonly    <false>\nundisclosed  <false>\n\nbodyonly => BOOLEAN\nPrint only the body of the message, not the whole.\n\nundisclosed => BOOLEAN\nDo not print the \"Bcc\" and \"Resent-Bcc\" lines. Default false, which means that they are\nnot printed.\n\n$obj->send($message, %options)\nTransmit the $message, which may be anything what can be coerced into a Mail::Message, so\nincluding Mail::Internet and MIME::Entity messages. It returns true when the transmission\nwas successfully completed.\n\n-Option  --Default\ninterval  new(interval)\nretry     new(retry)\nto        undef\n\ninterval => SECONDS\nretry => INTEGER\nto => STRING\nOverrules the destination(s) of the message, which is by default taken from the\n(Resent-)To, (Resent-)Cc, and (Resent-)Bcc.\n\n$obj->trySend($message, %options)\nTry to send the message. This will return true if successful, and false in case some\nproblems where detected. The $? contains the exit status of the command which was started.\n"
                },
                {
                    "name": "Server connection",
                    "content": "Extends \"Server connection\" in Mail::Transport.\n\n$obj->findBinary( $name, [@directories] )\nInherited, see \"Server connection\" in Mail::Transport\n\n$obj->remoteHost()\nInherited, see \"Server connection\" in Mail::Transport\n\n$obj->retry()\nInherited, see \"Server connection\" in Mail::Transport\n"
                },
                {
                    "name": "Error handling",
                    "content": "Extends \"Error handling\" in Mail::Transport.\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::Send->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::Send->log( [$level, [$strings]] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logPriority($level)\nMail::Transport::Send->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::Transport.\n\n$obj->DESTROY()\nInherited, see \"Cleanup\" in Mail::Reporter\n"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "Warning: Message has no destination\nIt was not possible to figure-out where the message is intended to go to.\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\nWarning: Resent group does not specify a destination\nThe message which is sent is the result of a bounce (for instance created with\nMail::Message::bounce()), and therefore starts with a \"Received\" header field. With the\n\"bounce\", the new destination(s) of the message are given, which should be included as\n\"Resent-To\", \"Resent-Cc\", and \"Resent-Bcc\".\n\nThe \"To\", \"Cc\", and \"Bcc\" header information is only used if no \"Received\" was found. That\nseems to be the best explanation of the RFC.\n\nAs alternative, you may also specify the \"to\" option to some of the senders (for instance\nMail::Transport::SMTP::send(to) to overrule any information found in the message itself\nabout the destination.\n\nError: Transporters of type $class cannot send.\nThe Mail::Transport object of the specified type can not send messages, but only receive\nmessage.\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::Send - send a message",
    "flags": [],
    "examples": [],
    "see_also": []
}