Retrieve Email Attachments

F

Fazer

Hello,

I need to access a POP or mayb IMAP based email account and extract
attachments (probably images) from the email messages. How can this
be done with the current two module libraries?

Thanks for any insight.

Faizan.
 
L

Lutz Horn

I need to access a POP or mayb IMAP based email account and extract
attachments (probably images) from the email messages. How can this
be done with the current two module libraries?

Use poplib or imaplib to get a message as a string.

Then use the email module (new in 2.2) to parse this string into an
instance of email.Messsage using

Use the methods of the resulting email.Message instance to get the
contents of the email.

Lutz
 
D

deelan

Fazer said:
Hello,

I need to access a POP or mayb IMAP based email account and extract
attachments (probably images) from the email messages. How can this
be done with the current two module libraries?
i've posted an example script non too long ago:
<http://tinyurl.com/yuhmn>

cheers,
deelan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top