help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] POP and SMTP assistance


From: Stephen Woolerton
Subject: [Help-smalltalk] POP and SMTP assistance
Date: Tue, 04 Sep 2007 09:10:06 +1200
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

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 := 'address@hidden' bindWithArguments: { Smalltalk getenv: 'USER'.
       IPAddress localHostName }."

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

        user := 'address@hidden'.
        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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]