Hi guys,
Is there a way to grab and save an attachment using Pharo? TIA Davide |
Davide,
On 11 Jun 2013, at 00:54, Davide Varvello <[hidden email]> wrote: > Hi guys, > Is there a way to grab and save an attachment using Pharo? There is a SMTPClient and even a SecureSMTPClient. And there is support for ZnMimePart. But I don't know exactly how to combine the two, although I think somebody once did on the list. It could be as easy as just reading the raw message. HTH, Sven > TIA > Davide > > > > -- > View this message in context: http://forum.world.st/Grabbing-email-attachments-tp4692693.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. -- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org |
Thank Sven, I'll look at them.
As Sven said, is there anyone on the list who managed SMTPClient and ZnMimePart? I just searched for SecureSMTPClient but I only found a raw description of a brittle implementation (http://forum.world.st/Combining-SqueakSSL-and-SMTPClient-td2956892.html) Davide
|
Davide,
On 11 Jun 2013, at 08:40, Davide Varvello <[hidden email]> wrote: Thank Sven, I'll look at them. Here is some more info (I had little time when I sent the previous reply). ZdcSecurePOP3Client is normally in your image, else it can be found in Zodiac-Extra (http://mc.stfx.eu/Zodiac) and should work for GMail, for example: ZdcSecurePOP3Client retrieveMessagesFromGMailAccount: '<your-name>@gmail.com' password: '<your-password>' limit: 5. Reading a multipart message goes like this: '/Users/sven/Desktop/Test.eml' asFileReference readStreamDo: [ :stream | stream binary. ZnMimePart readFrom: stream ]. Test.eml is a message that I sent to myself, containing an image. I just saved it from Apple Mail as raw text. The result should be something like the following screenshot: Note the nesting of mime parts. Please do upgrade to Zinc #bleedingEdge as I had to make a couple of fixes to get mime part support up to date. Good luck ! Sven Sven Van Caekenberghe-2 wroteDavide, |
I don't have it in my image, anyway no problem.
That's cool! Thank you very much, Sven Davide
|
Free forum by Nabble | Edit this page |