Some very useful business software connects with and interacts with email in various ways. If you are building or working with such software, you might want to know how Python accomplishes these tasks. This article series discusses how to use the email libraries built into Python. In this first part, POP3 is covered.
Many software systems require the ability to connect with and provide services that interact with email in different ways. Perhaps you’re writing software for a bulletin board that must notify users when new responses are posted in certain topics, or a piece of scheduling software that must notify users when new engagements are assigned to them. There are, of course, many further applications for integration between business or Web software with email.
Integrating with email allows for advantages from both business and portability perspectives. From a business perspective, integrating your software with email allows users to use their email accounts as a central place in which to get notifications and information about a wide range of business objectives. From a portability viewpoint, email adds a layer of abstraction, making it possible for a user to receive alerts from your software in any way they choose: via a classic email client, a Web client from a public computer or home, or even a cell phone or Blackberry capable of accessing standard email protocols.
This article series will discuss how to use the email libraries built in to Python. I will describe how to access email on both POP and IMAP servers, how to parse this mail into easily usable data structures, and how to create email items and then send them through an SMTP server.