Extracting email attachment when is_multipart() is False

John J. Lee jjl at pobox.com
Tue Nov 25 13:18:53 EST 2003


"Davor Cengija" <dcengija_IQ_Filter at inet.hr> writes:

> I need to write a script which should extract the attachment from a text
> file, which is saved as MIME mail message. Unfortunatelly,
> Message.is_multipart() returns False so msg.get_payload() returns the
[...]
> This is how my file/message looks like:
> 
> ====== start here ========
> This is a multi-part message in MIME format.
> 
> ------=_NextPart_000_0026_01C3B347.DBEA9660
> Content-Type: text/plain;
[...]

You seem to be missing the RFC 822 headers (From, To, Subject, etc.).


John




More information about the Python-list mailing list