[toc]In this tutorial you will learn how to receive email using the poplib module. The mail server needs to support pop3, but most mail servers do this. The Post Office Protocol (POP3) is for receiving mail only, for sending you will need the SMTP protocol.
Python Programming Bootcamp: Go from zero to hero
Every email will contain many variables, but these are the most important ones:
|from||where did the email come from?|
|to||where was the email sent to?|
Reading Email Example
You can request messages directly from a mail server using the Post Office Protocol (protocol). You do not have to worry about the internal protocol because you can use the poplib module.
Connect and authenticate with the server using:
The program below gets 10 emails from the server including mail header