{
    "mode": "perldoc",
    "parameter": "Mail::Transport::Mailx",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ATransport%3A%3AMailx/json",
    "generated": "2026-06-09T14:45:05Z",
    "synopsis": "my $sender = Mail::Transport::Mailx->new(...);\n$sender->send($message);",
    "sections": {
        "NAME": {
            "content": "Mail::Transport::Mailx - transmit messages using external mailx program\n",
            "subsections": []
        },
        "INHERITANCE": {
            "content": "Mail::Transport::Mailx\nis a Mail::Transport::Send\nis a Mail::Transport\nis a Mail::Reporter\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $sender = Mail::Transport::Mailx->new(...);\n$sender->send($message);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Implements mail transport using the external programs 'mailx', \"Mail\", or 'mail'. When\ninstantiated, the mailer will look for any of these binaries in specific system directories, and\nthe first program found is taken.\n\nWARNING: There are many security issues with mail and mailx. DO NOT USE these commands to send\nmessages which contains data derived from any external source!!!\n\nUnder Linux, freebsd, and bsdos the \"mail\", \"Mail\", and \"mailx\" names are just links to the same\nbinary. The implementation is very primitive, pre-MIME standard, what may cause many headers to\nbe lost. For these platforms (and probably for other platforms as well), you can better not use\nthis transport mechanism.\n\nExtends \"DESCRIPTION\" in Mail::Transport::Send.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Extends \"METHODS\" in Mail::Transport::Send.\n",
            "subsections": [
                {
                    "name": "Constructors",
                    "content": "Extends \"Constructors\" in Mail::Transport::Send.\n\nMail::Transport::Mailx->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>\nstyle                        <autodetect>\ntimeout     Mail::Transport  120\ntrace       Mail::Reporter   'WARNINGS'\nusername    Mail::Transport  undef\nvia         Mail::Transport  'mailx'\n\nexecutable => FILENAME\nhostname => HOSTNAME|ARRAY\ninterval => SECONDS\nlog => LEVEL\npassword => STRING\nport => INTEGER\nproxy => PATH\nretry => NUMBER|undef\nstyle => 'BSD'|'RFC822'\nThere are two version of the \"mail\" program. The newest accepts RFC822 messages, and\nautomagically collect information about where the message is to be send to. The BSD style\nmail command predates MIME, and expects lines which start with a '~' (tilde) to specify\ndestinations and such. This field is autodetect, however on some platforms both versions\nof \"mail\" can live (like various Linux distributions).\n\ntimeout => SECONDS\ntrace => LEVEL\nusername => STRING\nvia => CLASS|NAME\n"
                },
                {
                    "name": "Sending mail",
                    "content": "Extends \"Sending mail\" in Mail::Transport::Send.\n\n$obj->destinations( $message, [$address|ARRAY] )\nInherited, see \"Sending mail\" in Mail::Transport::Send\n\n$obj->putContent($message, $fh, %options)\nInherited, see \"Sending mail\" in Mail::Transport::Send\n\n$obj->send($message, %options)\nInherited, see \"Sending mail\" in Mail::Transport::Send\n\n$obj->trySend($message, %options)\n"
                },
                {
                    "name": "Server connection",
                    "content": "Extends \"Server connection\" in Mail::Transport::Send.\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::Send.\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::Mailx->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::Mailx->log( [$level, [$strings]] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logPriority($level)\nMail::Transport::Mailx->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::Send.\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: Sending via mailx mailer $program failed: $! ($?)\nMailx (in some shape: there are many different implementations) did start accepting\nmessages, but did not succeed sending it.\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::Mailx - transmit messages using external mailx program",
    "flags": [],
    "examples": [],
    "see_also": []
}