Trouble with the 'email' module

Amos Joshua snails at softhome.net
Sat May 10 06:04:50 EDT 2003


I'm writting an email client, retireving and parsing into
email.message's works, here's the printout of an email message (using
the _structure iterator from email.iterators):

multipart/mixed
    text/plain
    text/plain
    multipart/digest
        message/rfc822
            text/plain
        message/rfc822
            text/plain
        message/rfc822
            text/plain
        message/rfc822
            text/plain
        message/rfc822
            text/plain
    text/plain

(Actually, that printout is from the help file, there's no point in
sending myself an email, retrieving it, iterating through it and
printing it out, I got simmilar printout's last time I did)

I'm not really sure how to phrase my question. What I want to do now
is display this message object as a message to the user. I have the
proper tools to display html and/or text documents, but a message may
have several text/plain and/or text/html parts, so how do I know what
part is the 'message'? Further more, html email messages might include
references to images or other documents, so it seems to me I'll have
to write each part to a file - I can't find any function to do that,
is there an official way?




More information about the Python-list mailing list