35.3 IMAP4: imaplib
The imaplib module provides the IMAP4 class, which you use to connect to and communicate with an Internet Message Access Protocol version 4 (IMAP4) server. The IMAP4 protocol is intended for managing emails on a mail server, similar to the POP3 protocol. Unlike POP3, with IMAP4 the emails mostly remain on the mail server, which has the advantage that you have full access to all archived emails from anywhere—even from a different device while you’re on vacation, for example. Nowadays, most email providers offer both POP3 and IMAP4 access. Compared to POP3, IMAP4 supports commands for convenient management of emails on the server. For example, you can create subfolders and assort emails into them.
Unlike previous protocols ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access