simple script to read and output Mailbox body to file.

Chuck Amadi chuck at smtl.co.uk
Wed Jun 9 05:20:00 EDT 2004


Hi all forget my last post about all email body messages I added a comment 
before break . Sorry for reading my own comments lines.

I get output desired .Now to pass to an external File.

for mail in mbox:
#       body = mail.get_payload()
#       bodies.append(body)
#       msg = mail.message_from_file(mail)
        print 'mail'
        print mail['Subject']
        print mail.get_content_type()#text/plain
        print mail.get_payload()
#        break # just look at one message






More information about the Python-list mailing list