Stephen wrote:
> I've got another question...
>
> I see there are SMTP, POP and IMAP libraries there. I
haven't found any
> sample code in the source or after extensive googling.
If someone could
> point me in the right direction for the docs that would
be really
> appreciated. (I'm assuming that the code has been
adapted from another
> smalltalk for which there is documentation.)
Unfortunately, there are no docs. The code was adapted from
public
domain or (for IMAP) LGPL implementation.
However, SMTP and POP are relatively easy to figure out from
the
examples. For example, for SMTP there is this:
exampleHost: host
"NetClients.SMTP.SMTPClient exampleHost:
'localhost'."
| user message client |
user := '%1 %2' bindWithArguments: { Smalltalk getenv:
'USER'.
IPAddress localHostName }.
message := MIME.MimeEntity readFrom:
('From: ', user, '
To: ', user, '
To: foo', user, '
Bcc: ', user, '
Subject: Test mail from Smalltalk (SMTPClient)
This is a test mail from Smalltalk (SMTPClient).
') readStream.
client := SMTPClient connectToHost: host.
[client sendMessage: message]
ensure: [client close].!
It connects to the given host, port 25, and sends a small
message.
Likewise, this is for POP:
exampleHost: host username: username password: password
"NetClients.POP.POPClient exampleHost: ...
etc."
| client |
client := self connectToHost: host.
[client
username: username
password: password.
client login.
Transcript showCr: 'New messages: ', client
newMessagesCount
printString.
Transcript showCr: 'bytes ', client newMessagesSize
printString.
Transcript showCr: 'ids ', client newMessagesIds
printString.
Transcript showCr: 'sizes ', client newMessages
printString.
client
getNewMailMessages: [:m | m inspect]
delete: false
] ensure: [client close] ! !
If you'd like to contribute back documentation patches as
part of your
experimentation, you're really welcome!
Paolo
_______________________________________________
help-smalltalk mailing list
help-smalltalk gnu.org
http://lists.gnu.org/mailman/listinfo/help-smalltalk
|