mime email creation with attachment

Fredrik Lundh fredrik at pythonware.com
Tue Oct 19 05:29:59 EDT 1999


Rene <rj.nederhand at pg.tno.nl> wrote:
> I try to automatically create an email message containing an attachment.
> Untill now I created the following code, but the format it sends can't be
> read by outlook 98 (it doesn't do uudecode, while it should be able to do
> that).

(fwiw, outlook express handles mails from this
program just fine).

to make it use base64 encoding, just change the
content type to "base64", and use base64.encode
instead of uu.encode.

and make sure to add "mime-version", "to", and
perhaps some other headers as well.

(btw, XLS-files are not plain text files.  use "rb"
when opening the file).

</F>

<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list