Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: Read POP3 E-mail messages

Python: Read POP3 E-mail messages
{filelink=16703}

import poplib
import getpass
serveur = poplib.POP3('mail.example.com')
#User Authentication
serveur.user(getpass.getuser())
serveur.pass_(getpass.getpass())
# Get message count
nbr_message = len(serveur.list()[1])
# print message subjects
for elem in range(nbr_message) :
    for msg in serveur.retr(elem+1)[1]:
        if msg.startswith('Subject'):
            print msg
            break
serveur.quit()

Users who found this page were searching for:

  • python read pop3 account
  • python open file
  • python change dir
  • python read file
  • tk checkbutton example
  • python merge two dict

No comments yet.

Leave a Comment