35 Email
In this section, we’ll introduce modules of the standard library that allow you to communicate with an email server—that is, to fetch email from it or to send email through the server.
An email is sent via an SMTP server, with which communication is possible via a protocol of the same name. For this reason, in the first subsection we’ll introduce the smtplib module of the standard library, which implements this communication protocol.
There are two common ways to download a received email: POP3 and IMAP4 protocols. Both can be used with the respective module, poplib or imaplib.
The last section will then describe the email module of the standard library, which allows any kind of file (usually images or documents) to be sent with an email ...
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