IMAP and SMTP - documentation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

IMAP and SMTP - documentation

Stephen-71
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.)

By the way, are there any LDAP libraries?

Thank you
Stephen


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: IMAP and SMTP - documentation

Paolo Bonzini
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
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: IMAP and SMTP - documentation

Stephen-71
>
> 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:
>
Thank you for the example code. By the way, where are the examples you
have referenced? I have had a look again in
/usr/share/smalltalk/examples/README and there is nothing there that
remotely looks like a mail example.
>
>
> If you'd like to contribute back documentation patches as part of your
> experimentation, you're really welcome!
I'll try to.

Stephen


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: IMAP and SMTP - documentation

Paolo Bonzini
Stephen wrote:
>>
>> 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:

They are in the source code for SMTP itself.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk