Website hosting service by

 Back to Index

11.9.2 POP3 Example

Here is a minimal example (without error checking) that opens a mailbox and retrieves and prints all messages:


import getpass, poplib

M = poplib.POP3('localhost')
numMessages = len(M.list()[1])
for i in range(numMessages):
    for j in M.retr(i+1)[1]:
        print j

At the end of the module, there is a test section that contains a more extensive example of usage.




2002-2004 Webhosting Service


Disclaimer: This documentation is provided only for the benefits of our hosting customers.
For authoritative source of the documentation, please refer to offers domain name registration, domain name transfer and domain search services  

Cheap domain registration : Register domain name or buy domain name, including free domain hosting services


Domain registration : Buy domain name or register domain name from $5.95/year only