owainlewis / clojure-mail

A Clojure library for parsing, downloading and reading email from IMAP servers.
202 stars 54 forks source link

Extract Attachement #49

Closed fdabrao closed 7 years ago

fdabrao commented 8 years ago

Hello,

How can I extract the attachement and save it to a file?

Regards

fdabrao commented 8 years ago

I used this

(let [gstore (gmail/store usuario senha)
                message (get-message gstore)]
        (.saveFile
            (.getBodyPart
                (.getContent message) 1) arquivo) ;; 1 = position of multiparts
        (.close gstore))