[Tutor] I am trying to read and decode an emails PDF attachment via python,

dave selby dave6502 at gmail.com
Sat Aug 20 11:58:38 CEST 2011


I am trying to read and decode an emails PDF attachment via python,
its a dedicated mailbox, anything emailed there is to be read by the
script, deleted from the mailbox and processed.

http://pastebin.com/VA1gwWH3

def get_next_mail() works AOK, I get a nice long string containing the
next email and PDF data block but when I execute

msg.is_multipart()
I get False ???

And when I execute
msg.get_payload()
I get nothing

Any ideas anyone, at a guess its because my string is not formatted
correctly, can anyone advise ?

Cheers

Dave

-- 

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


More information about the Tutor mailing list