simple example of mimelib? and embedding (not attaching) images in email sent with python.

Barry A. Warsaw barry at zope.com
Sun Sep 16 03:07:28 EDT 2001


[A month ago, I mention mimelib...]

>>>>> "ph" == phil hunt <philh at comuno.freeserve.co.uk> writes:

    ph> I think an examples section would be a very good idea.

I agree, and I will add this to the documentation when I merge it into
Python 2.2's standard library.  Note that we've agreed on a package
name: `email' It Shall Be.

    ph> I also think the library would benefit from being conceptually
    ph> oriented from the user's point of view rather than the
    ph> implementer's. I'll give you an example of what I mean:

    ph> To create a new Message (object representation of an email
    ph> message) from a string containing the message one does:

[example deleted]

    ph> What's wrong with that? The user has a string, and wants to
    ph> make a Message from it. He should be able to say:

    ph>    msg = mimelib.makeMessageFromString(msgStr)

    ph> and mimelib should sort out the details itself.

Excellent idea.  mimelib 0.5 will have mimelib.messageFromString() and
mimelib.messageFromFile() convenience functions.
    
    ph> Instead, the user is forced to think in terms of the
    ph> implementation detail of how mimelib parses text. Note also
    ph> that this is documentted under the heading "Parsing MIME
    ph> documents" which wants to be changed to something like
    ph> "Parsing Mail Documents".

There are several things I will do when I merge mimelib into Python
2.2.  I'm going to fix some of the misnamed and misplaced modules and
functions, and I'm going to generalize the documentation so that it
isn't so MIME-centric.  The `email' package will really be a very
general package for handling things email-ish.

My plan is to release mimelib 0.5 on Monday, and this will likely be
the last independent release.  I will be merging the `email' package
into Python for the 2.2a4 release later on in the week.

    ph> Incidently, did you look at the mailheader.py code I sent you?
    ph> Did you find any ideas in it worth using?

A few, thanks.

    ph> Is it [mimelib] going to be RFC2822 compliant?

That's definitely the intent.

-Barry




More information about the Python-list mailing list