Cannot get email package to work

Jeff Blaine cjblaine at gmail.com
Fri Sep 17 23:46:26 CEST 2004


Python 2.3.4 for Windows

Just trying a simple test today.  I clicked on an email message in Mozilla
1.7.3's mail reader.  I selected 'Save As' and saved it as the default type.
I opened the file with Wordpad to examine it, and sure enough it looks like
a complete email message with headers, newline, and body.

     >>> import email
     >>> myfd = open('c:/temp/my-work.eml')
     >>> msg = email.message_from_file(myfd)
     >>> msg
     <email.Message.Message instance at 0x00A70E18>
     >>> msg.get_all('From')
     >>> print msg
     From nobody Fri Sep 17 17:26:06 2004


     >>> msg.keys()
     []

?



More information about the Python-list mailing list