Parsing mime multipart/alternative emails for the message body

Barry A. Warsaw barry at zope.com
Fri Feb 8 17:38:35 EST 2002


>>>>> "JPM" == Joao Prado Maia <JMaia at lexgen.com> writes:

    JPM> I'm trying to parse mime based emails to get the message
    JPM> body, but I didn't have much luck on trying to find a way.

You might want to give Python 2.2's email package[*] a try.  It is
specifically designed to do all the things you'd want to do to and on
an email message, including parse a text file into an object model,
etc.

-Barry

[*] Or for older Python's look at the distutils-able mimelib/email
package at:

    http://sourceforge.net/projects/mimelib/

The version in CVS has some much better support for multibyte
character sets.



More information about the Python-list mailing list