O'Reilly logo

The Python 3 Standard Library by Example, Second Edition by Doug Hellmann

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Email

Email is one of the oldest forms of digital communication, but it is still one of the most popular. Python’s standard library includes modules for sending, receiving, and storing email messages.

smtplib (page 841) communicates with a mail server to deliver a message. smtpd (page 847) can be used to create a custom mail server, and provides classes useful for debugging email transmission in other applications.

imaplib (page 864) uses the IMAP protocol to manipulate messages stored on a server. It provides a low-level API for IMAP clients, and can query, retrieve, move, and delete messages.

Local message archives can be created and modified with mailbox (page 852) using several standard formats including the popular mbox and Maildir ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required