From: Sven Van Caekenberghe <sven@stfx.eu>
To: Any question about pharo is welcome <pharo-users@lists.pharo.org>
Sent: Tuesday, June 11, 2013 11:56 AM
Subject: Re: [Pharo-users] Grabbing email attachments

Davide,

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:

I don't have it in my image, anyway no problem.

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.




That's cool!
Thank you very much, Sven

Davide

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 wrote
Davide,

On 11 Jun 2013, at 00:54, Davide Varvello &lt;

varvello@

&gt; 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





--
View this message in context: http://forum.world.st/Grabbing-email-attachments-tp4692693p4692707.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.