Getting "empty" attachment with smtplib

Dieter Maurer dieter at handshake.de
Thu Nov 15 08:37:24 CET 2012


Tobiah <toby at tobiah.org> writes:

> I just found out that the attachment works fine
> when I read the mail from the gmail website.  Thunderbird
> complains that the attachment is empty.

The MIME standard (a set of RFCs) specifies how valid messages
with attachments should look like.

Fetch the mail (unprocessed if possible) and look at its
structure. If it is conformant to the MIME standard, then
"Thunderbird" made a mistake; otherwise, something went wrong
with the message construction.

I can already say that "smtplib" is not to blame. It is (mostly) unconcerned
with the internal structure of the message -- and by itself
will not empty attachments.



More information about the Python-list mailing list