Today's Smalltalk Daily looks at retrieving email messages using IMAP using Cincom Smalltalk. The code I used in the screencast is below; to skip to the video, click here.
"login"
imap := IMAPClient host: cincom.
netuser := NetUser username: username password: password.
imap user: netuser.
imap connect; login.
"work with the mailbox"
data := imap examineMailbox: 'inbox'.
numMessages := data first value asNumber.
msgs := imap fetchMessages: (1 to: numMessages) asArray.
"delete from server"
imap markForDelete: (1 to: numMessages) asArray.
imap close.
To watch now, use the viewer below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
You can also watch it on YouTube:
Technorati Tags:
smalltalk, email, imap