List Info

Thread: POP and SMTP assistance




POP and SMTP assistance
user name
2007-09-03 16:10:06
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 := 'mailacctserver.fqdn'.
         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)>>#doesNotU
nderstand:
Smalltalk.UndefinedObject>>#executeStatements


_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk

Re: POP and SMTP assistance
country flaguser name
United States
2007-09-03 16:56:10
Stephen Woolerton wrote:
> ~/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.
 > ...
>  ~/projects_smalltalk $ gst pop.st
> Object: nil error: did not understand #connectToHost:

POP and SMTP are in the NetClients package; I suggest you
read up on 
packages in the manual, chapter 3 "Packages".

Do not load the .st files included with GST manually; they
are all in 
packages.  You can load NetClients with PackageLoader
fileInPackages: 
#('NetClients')!

-- 
;;; Stephen Compall ** http://scompall.no
candysw.com/blog **
But you know how reluctant paranormal phenomena are to
reveal
themselves when skeptics are present. --Robert Sheaffer, SkI
9/2003


_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk

Re: POP and SMTP assistance
country flaguser name
United States
2007-09-07 22:06:42
On Sat, 2007-09-08 at 14:55 +1200, Stephen wrote:
> Object: nil error: did not understand #readFrom:

In general, when you try to send a message to a class that
you name in
your code (MimeEntity here), and you get an error that says
it is nil,
it means that GST couldn't find such a class in your
method's namespace.

> PackageLoader fileInPackages: #('NetClients')!
> Smalltalk addSubspace: #NetClients!

This #addSubspace: send is vacuous.  What are you trying to
do here?

-- 
;;; Stephen Compall ** http://scompall.no
candysw.com/blog **
"Peta" is Greek for fifth; a petabyte is 10 to the
fifth power, as
well as fifth in line after kilo, mega, giga, and tera.
  -- Lee Gomes, performing every Wednesday in his tech
column
     "Portals" on page B1 of The Wall Street
Journal

_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk

Re: POP and SMTP assistance
user name
2007-09-07 22:11:35
Sorry, brain fade.

Should have used NetClients.MIME.MimeEntity.

Stephen




_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )