Logging Into a POP3 Mailbox
Friday June 6, 2008
Logging into a POP3 mailbox is very straightforward with the
poplib module. Assuming you know the username and password, import poplib, create an instance p of whichever POP3 class you need, and use the following methods:
p.pass_(password)
p.user(username)
You can then call other methods to retrieve the mail and otherwise manage the mailbox.
Note that, if the password and username arguments are not passed by variable name, you will need to put them in quotes. You can learn more about each of these methods and the rest of the poplib module in the series "Using poplib to Access a POP3 Mail Server".