Ruby + IMAP + Attachment

S

Stian Hole

I am trying read out attachments using Net::IMAP, but this seems to be
going nowhere. Docs make no mention of such, and I am at a loss on where
to actually begin. I can read messages and such using Net::IMAP, even
got the filenavn of the attachment, but not the data for it, and thus
not able to store it as file or in a database.

Any suggestions?

Best regards,
Stian
 
T

ts

S> I am trying read out attachments using Net::IMAP, but this seems to be
S> going nowhere. Docs make no mention of such, and I am at a loss on where
S> to actually begin. I can read messages and such using Net::IMAP, even
S> got the filenavn of the attachment, but not the data for it, and thus
S> not able to store it as file or in a database.

You have an example in comp.lang.ruby

Search the thread "Retrieve email attachments using Net::IMAP" in google

Basically when you have a message id, you can do

image.fetch(message_id, "BODY[1]")
image.fetch(message_id, "BODY[2]")



Guy Decoux
 

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

No members online now.

Forum statistics

Threads
474,209
Messages
2,571,089
Members
47,689
Latest member
kilaocrhtbfnr

Latest Threads

Top