1. Home
  2. Computing & Technology
  3. Python

Using poplib to Access a POP3 Mail Server

From Al Lukaszewski, for About.com

1 of 4

Two Classes: POP3 and POP3_SSL

As you might guess, POP3 is the third incarnation of the Post Office Protocol. The idea being that mail is collected at the post office, mail transfer agents act as delivery men and women who drop the post in your box, and you collect it when you are ready. It is also a line-based protocol. This means that each line is sent separately, thus consuming a lot of processing cycles to retrieve the entire mailbox. The poplib module offers a very easy, yet powerful interface for collecting email from your POP3 mailbox. The module has only two classes:
  • class POP3(host[. port]): The plain text implementation of the POP3 protocol. If port is left off, the class defaults to the POP3 standard port 110.
  • class POP3_SSL(host[, port[, keyfile[, certfile]]]): The SSL-encrypted implementation of the POP3 protocol. The default port is 995, but a different one can be specified. The keyfile specifies an optional PEM-formatted private key. The certfile is a certificate chain file for SSL.
Each class supports several methods for interacting with a remote POP3 account. These are detailed in the following pages.
Explore Python
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Python
  4. Python Library
  5. Python Programming - Python Library - poplib Module - Accessing POP3 Mailboxes with poplib

©2009 About.com, a part of The New York Times Company.

All rights reserved.