March 2019
Beginner
490 pages
12h 40m
English
As we mentioned earlier, accessing emails over the IMAP protocol doesn't necessarily download them onto the local device.
Python provides a library called imaplib, which can be used for accessing messages over the IMAP protocol. This library provides the IMAP4() class, which takes the host and port for implementing this protocol as arguments. The default port is 143.
The IMAP4_SSL() class has the capacity to connect over an SSL encrypted socket and provides a secure version of the IMAP4 protocol by using 993 as the default port.
A typical example of what an IMAP client looks like can be seen here:
mailbox = imaplib.IMAP4_SSL("IMAP_SERVER", "SERVER_PORT")mailbox.login('username', 'password')mailbox.select('Inbox') ...Read now
Unlock full access