SMTPClient and SSL

Rob Withers reefedjib at yahoo.com
Thu Dec 13 16:53:50 UTC 2007


Ok, here is what I have.  It establishes a connection and talks to the 
server, but I was getting a Bad credentials error.  I have attached the code 
that bridges SSL and SMTP.  You need to load SSL from the Universes browser, 
then file in this code.  Then you can connect with something like:

client := SMTPClient openOnSSLHostNamed: 'smtp.gmail.com' port: 995.
client user: 'myusername at gmail.com'; password: 'mypassword';
    login;
    initiateSession.
client mailFrom: 'admin at mydomain.com';
    recipient: 'targetuser at hotmail.com';
    data: 'Subject: This is a test
From: admin at mydomain.com
To: targetuser at hotmail.com

Hi.
Bye.
Richard'.
client quit.


good luck!
Rob

----- Original Message ----- 
From: "Richard Eng" <richard.eng at rogers.com>
To: "The general-purpose Squeak developers list" 
<squeak-dev at lists.squeakfoundation.org>
Sent: Wednesday, December 12, 2007 8:14 PM
Subject: Re: SMTPClient and SSL


> Unfortunately, I'm a Smalltalk newbie. (After 5 months, I still don't feel
> all that knowledgeable.) So I'm the wrong person to tackle something like
> this.
>
> Also, I just barely understand what a socket is.  :-(
>
> Regards,
> Richard
>
> -------
> There is an SSL impl in squeak.  The challenge we face is to get 
> SMTPClient
> to run on top of an SSLSocket.   SSLSocket does not implement all of the
> protocol of a Socket.  Also, there is nothing which tells SMTPSocket to 
> use
> an SSLSocket instead of a Socket.  You could write a subclass of 
> SMTPClient
> called SMTPOverSSLClient and do the right thing connecting and we could
> extend SSLSocket to do the right thing.  I am willing to help. 
> Interested?
>
> Rob
>
>
>
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SMTP-SSL.2.cs
Type: application/octet-stream
Size: 10077 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20071213/b4c0d4f9/SMTP-SSL.2.obj


More information about the Squeak-dev mailing list