Great!! That's fantastic! I didn't try, yet. Does it support STARTTLS as well? Norbert Am 08.12.2011 um 12:27 schrieb Sven Van Caekenberghe:
This week I found some time to finish two small examples, ZdcSecurePOP3Client and ZdcSecureSMTPClient. These are subclasses from the POP3Client and SMTPClient already present, but open a ZdcSecureSocketStream to the POP3/SMTP server and connect it at the SSL level. This means you can now receive and/or send email securely over SSL, to GMail for example:
"Retrieve (but not delete) your last 5 messages"
ZdcSecurePOP3Client retrieveMessagesFromGMailAccount: '<your-name>@gmail.com' password: '<your-password>' limit: 5.
(Note that you have to enable POP3 access in your GMail account)
"Send a message"
| mailMessage | mailMessage := MailMessage empty. mailMessage setField: 'subject' toString: 'ZdcSecureSMTPClient Test'. mailMessage body: (MIMEDocument contentType: 'text/plain' content: 'This is test from Pharo Smalltalk'). ZdcSecureSMTPClient sendUsingGMailAccount: '<your-name>@gmail.com' password: '<your-password>' to: '<email-address>' message: mailMessage
The code is in the 'Zodiac-Extra' package in the http://www.squeaksource.com/Zodiac repository. Of course, you also have to install Zodiac and a plugin, see http://zdc.stfx.eu/ for more details.
Sven