Retrieving e-mails by using POP3 with poplib

The stored e-mail messages can be downloaded and read by the local computer. The POP3 protocol can be used to download the messages from the e-mail server. Python has a module called poplib, and it can be used for this purpose. This module provides two high-level classes, POP() and POP3_SSL(),which implement the POP3 and POP3S protocols respectively for communicating with a POP3/POP3S server. It accepts three arguments, host, port, and timeout. If port is omitted, then the default port (110) can be used. The optional timeout parameter determines the length (in seconds) of the connection timeout at the server.

The secure version of POP3() is its subclass POP3_SSL(). It takes additional parameters, such ...

Get Learning Python Network Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.