{
    "mode": "info",
    "parameter": "Net::POP3",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/Net%3A%3APOP3/json",
    "generated": "2026-07-05T11:51:14Z",
    "synopsis": "use Net::POP3;\n# Constructors\n$pop = Net::POP3->new('pop3host');\n$pop = Net::POP3->new('pop3host', Timeout => 60);\n$pop = Net::POP3->new('pop3host', SSL => 1, Timeout => 60);\nif ($pop->login($username, $password) > 0) {\nmy $msgnums = $pop->list; # hashref of msgnum => size\nforeach my $msgnum (keys %$msgnums) {\nmy $msg = $pop->get($msgnum);\nprint @$msg;\n$pop->delete($msgnum);\n}\n}\n$pop->quit;",
    "sections": {
        "NAME": {
            "content": "Net::POP3 - Post Office Protocol 3 Client class (RFC1939)\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Net::POP3;\n\n# Constructors\n$pop = Net::POP3->new('pop3host');\n$pop = Net::POP3->new('pop3host', Timeout => 60);\n$pop = Net::POP3->new('pop3host', SSL => 1, Timeout => 60);\n\nif ($pop->login($username, $password) > 0) {\nmy $msgnums = $pop->list; # hashref of msgnum => size\nforeach my $msgnum (keys %$msgnums) {\nmy $msg = $pop->get($msgnum);\nprint @$msg;\n$pop->delete($msgnum);\n}\n}\n\n$pop->quit;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module implements a client interface to the POP3 protocol,\nenabling a perl5 application to talk to POP3 servers. This\ndocumentation assumes that you are familiar with the POP3 protocol\ndescribed in RFC1939.  With IO::Socket::SSL installed it also provides\nsupport for implicit and explicit TLS encryption, i.e. POP3S or\nPOP3+STARTTLS.\n\nA new Net::POP3 object must be created with the new method. Once this\nhas been done, all POP3 commands are accessed via method calls on the\nobject.\n\nThe Net::POP3 class is a subclass of Net::Cmd and (depending on\navaibility) of IO::Socket::IP, IO::Socket::INET6 or IO::Socket::INET.\n\nClass Methods\n\"new([$host][, %options])\"\nThis is the constructor for a new Net::POP3 object. $host is the\nname of the remote host to which an POP3 connection is required.\n\n$host is optional. If $host is not given then it may instead be\npassed as the \"Host\" option described below. If neither is given\nthen the \"POP3Hosts\" specified in \"Net::Config\" will be used.\n\n%options are passed in a hash like fashion, using key and value\npairs.  Possible options are:\n\nHost - POP3 host to connect to. It may be a single scalar, as\ndefined for the \"PeerAddr\" option in IO::Socket::INET, or a\nreference to an array with hosts to try in turn. The \"host\" method\nwill return the value which was used to connect to the host.\n\nPort - port to connect to.  Default - 110 for plain POP3 and 995\nfor POP3s (direct SSL).\n\nSSL - If the connection should be done from start with SSL,\ncontrary to later upgrade with \"starttls\".  You can use SSL\narguments as documented in IO::Socket::SSL, but it will usually use\nthe right arguments already.\n\nLocalAddr and LocalPort - These parameters are passed directly to\nIO::Socket to allow binding the socket to a specific local address\nand port.  For compatibility with older versions ResvPort can be\nused instead of LocalPort.\n\nDomain - This parameter is passed directly to IO::Socket and makes\nit possible to enforce IPv4 connections even if IO::Socket::IP is\nused as super class. Alternatively Family can be used.\n\nTimeout - Maximum time, in seconds, to wait for a response from the\nPOP3 server (default: 120)\n\nDebug - Enable debugging information\n\nObject Methods\nUnless otherwise stated all methods return either a true or false\nvalue, with true meaning that the operation was a success. When a\nmethod states that it returns a value, failure will be returned as\nundef or an empty list.\n\n\"Net::POP3\" inherits from \"Net::Cmd\" so methods defined in \"Net::Cmd\"\nmay be used to send commands to the remote POP3 server in addition to\nthe methods documented here.\n\n\"host()\"\nReturns the value used by the constructor, and passed to\nIO::Socket::INET, to connect to the host.\n\n\"auth($username, $password)\"\nAttempt SASL authentication.\n\n\"user($user)\"\nSend the USER command.\n\n\"pass($pass)\"\nSend the PASS command. Returns the number of messages in the\nmailbox.\n\n\"login([$user[, $pass]])\"\nSend both the USER and PASS commands. If $pass is not given the\n\"Net::POP3\" uses \"Net::Netrc\" to lookup the password using the host\nand username. If the username is not specified then the current\nuser name will be used.\n\nReturns the number of messages in the mailbox. However if there are\nno messages on the server the string \"0E0\" will be returned. This\nis will give a true value in a boolean context, but zero in a\nnumeric context.\n\nIf there was an error authenticating the user then undef will be\nreturned.\n\n\"starttls(%sslargs)\"\nUpgrade existing plain connection to SSL.  You can use SSL\narguments as documented in IO::Socket::SSL, but it will usually use\nthe right arguments already.\n\n\"apop([$user[, $pass]])\"\nAuthenticate with the server identifying as $user with password\n$pass.  Similar to \"login\", but the password is not sent in clear\ntext.\n\nTo use this method you must have the Digest::MD5 or the MD5 module\ninstalled, otherwise this method will return undef.\n\n\"banner()\"\nReturn the sever's connection banner\n\n\"capa()\"\nReturn a reference to a hash of the capabilities of the server.\nAPOP is added as a pseudo capability.  Note that I've been unable\nto find a list of the standard capability values, and some appear\nto be multi-word and some are not.  We make an attempt at\nintelligently parsing them, but it may not be correct.\n\n\"capabilities()\"\nJust like capa, but only uses a cache from the last time we asked\nthe server, so as to avoid asking more than once.\n\n\"top($msgnum[, $numlines])\"\nGet the header and the first $numlines of the body for the message\n$msgnum. Returns a reference to an array which contains the lines\nof text read from the server.\n\n\"list([$msgnum])\"\nIf called with an argument the \"list\" returns the size of the\nmessage in octets.\n\nIf called without arguments a reference to a hash is returned. The\nkeys will be the $msgnum's of all undeleted messages and the values\nwill be their size in octets.\n\n\"get($msgnum[, $fh])\"\nGet the message $msgnum from the remote mailbox. If $fh is not\ngiven then get returns a reference to an array which contains the\nlines of text read from the server. If $fh is given then the lines\nreturned from the server are printed to the filehandle $fh.\n\n\"getfh($msgnum)\"\nAs per get(), but returns a tied filehandle.  Reading from this\nfilehandle returns the requested message.  The filehandle will\nreturn EOF at the end of the message and should not be reused.\n\n\"last()\"\nReturns the highest $msgnum of all the messages accessed.\n\n\"popstat()\"\nReturns a list of two elements. These are the number of undeleted\nelements and the size of the mbox in octets.\n\n\"ping($user)\"\nReturns a list of two elements. These are the number of new\nmessages and the total number of messages for $user.\n\n\"uidl([$msgnum])\"\nReturns a unique identifier for $msgnum if given. If $msgnum is not\ngiven \"uidl\" returns a reference to a hash where the keys are the\nmessage numbers and the values are the unique identifiers.\n\n\"delete($msgnum)\"\nMark message $msgnum to be deleted from the remote mailbox. All\nmessages that are marked to be deleted will be removed from the\nremote mailbox when the server connection closed.\n\n\"reset()\"\nReset the status of the remote POP3 server. This includes resetting\nthe status of all messages to not be deleted.\n\n\"quit()\"\nQuit and close the connection to the remote POP3 server. Any\nmessages marked as deleted will be deleted from the remote mailbox.\n\n\"caninet6()\"\nReturns whether we can use IPv6.\n\n\"canssl()\"\nReturns whether we can use SSL.\n\nNotes\nIf a \"Net::POP3\" object goes out of scope before \"quit\" method is\ncalled then the \"reset\" method will called before the connection is\nclosed. This means that any messages marked to be deleted will not be.\n",
            "subsections": []
        },
        "EXPORTS": {
            "content": "None.\n",
            "subsections": []
        },
        "KNOWN BUGS": {
            "content": "See <https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Net::Netrc, Net::Cmd, IO::Socket::SSL.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Graham Barr <gbarr@pobox.com <mailto:gbarr@pobox.com>>.\n\nSteve Hay <shay@cpan.org <mailto:shay@cpan.org>> is now maintaining\nlibnet as of version 1.2202.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (C) 1995-2004 Graham Barr.  All rights reserved.\n\nCopyright (C) 2013-2016, 2020 Steve Hay.  All rights reserved.\n",
            "subsections": []
        },
        "LICENCE": {
            "content": "This module is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself, i.e. under the terms of either the\nGNU General Public License or the Artistic License, as specified in the\nLICENCE file.\n",
            "subsections": []
        },
        "VERSION": {
            "content": "Version 3.13\n",
            "subsections": []
        },
        "DATE": {
            "content": "23 Dec 2020\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "See the Changes file.\n\nperl v5.34.0                      2026-06-23                  Net::POP3(3perl)",
            "subsections": []
        }
    },
    "summary": "Net::POP3 - Post Office Protocol 3 Client class (RFC1939)",
    "flags": [],
    "examples": [],
    "see_also": []
}