POP and SMTP assistance

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

POP and SMTP assistance

Stephen-71
Hi there,

I'm trying to get POP and SMTP working.

I've got two POP tests here. One in which I copied the POP example in
the POP.st code and then added a namespace so it would run;  (called
pop.st). For the second test (pop2.st), it looked like the example code
is a class method so I tried calling it.
After the POP test, there is an SMTP test.

I tried installing GNU-Smalltalk on another machine and got the same
result. Since none of my tests work!, I'm hoping someone can show me
what I've done wrong.

I've copied the smalltalk code and excution results below (real
username, password, and hostname modfied to present on web)

Thank you

Code below....

~/projects_smalltalk $ cat pop.st

Smalltalk addSubspace: #NetClients!
"Namespace current: NetClients!"
     | client host username password popClient|
     host := 'server.fqdn'.
     username := 'mailacct'.
     password := 'mailacctpassword'.
     "popClient := POPClient new."
     client := POPClient 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] ! !


  ~/projects_smalltalk $ gst pop.st
Object: nil error: did not understand #connectToHost:
MessageNotUnderstood(Exception)>>#signal
UndefinedObject(Object)>>#doesNotUnderstand:
UndefinedObject>>#executeStatements

----------------------

  ~/projects_smalltalk $ cat pop2.st
Smalltalk addSubspace: #NetClients!
"Namespace current: NetClients!"
     | client host username password popClient|
     host := 'server.fqdn'.
     username := 'mailacct'.
     password := 'mailacctpassword'.
     "popClient := POPClient new."
     POPClient exampleHost: host username: username password: password.


  ~/projects_smalltalk $ gst pop2.st
Object: nil error: did not understand #exampleHost:username:password:
MessageNotUnderstood(Exception)>>#signal
UndefinedObject(Object)>>#doesNotUnderstand:
UndefinedObject>>#executeStatements

----------------------

  ~/projects_smalltalk $ cat smtp.st

     "user := '%1@%2' bindWithArguments: { Smalltalk getenv: 'USER'.
        IPAddress localHostName }."

Smalltalk addSubspace: #NetClients!
Namespace current: NetClients!
     | user message client host |

         user := '[hidden email]'.
         host := 'server.fqdn'.
     message := 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].!

  ~/projects_smalltalk $ gst smtp.st
Object: nil error: did not understand #readFrom:
Smalltalk.MessageNotUnderstood(Smalltalk.Exception)>>#signal
Smalltalk.UndefinedObject(Smalltalk.Object)>>#doesNotUnderstand:
Smalltalk.UndefinedObject>>#executeStatements



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