fixes to send mails with gemstone

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

fixes to send mails with gemstone

EstebanLM
Hi,
I made a couple of fixes to make seaside send correct emails, also using authenticated accounts.
I tweak something in

GRGemStonePlatform>>seasideDeliverEmailMessage:

and also changed SendMail to accept user and password.
Maybe this code can be integrated into gemstone?

Cheers,
Esteban

This is the code changed (I don't know how to produce a changeset in gemstone, I'm sorry)

in GRGemStonePlatform

seasideDeliverEmailMessage: aWAEmailMessage
        | client |
        client := SendMail new.

        "user login information if applicable"
        self seasideSmtpUsername ifNotNilDo: [:username |
                client user: username.
                self seasideSmtpPassword ifNotNilDo: [:password |
                        client password: password]].

        "use HELO/EHLO ip address format [127.0.0.1] if local host name is ip"
        (self seasideIsIpAddress: client ownDomainName)
                ifTrue: [client ownDomainName: '[', client ownDomainName, ']'].

        "deliver the mail"
        client
                mailhostName: self seasideSmtpServer;
                smtpPort: self seasideSmtpPort;
                from: aWAEmailMessage from address greaseString;
                to: (String streamContents: [ :stream |
                        aWAEmailMessage recipientsAddresses
                                do: [ :each | stream nextPutAll: each greaseString ]
                                separatedBy: [ stream nextPut: $, ] ]);
                subject: aWAEmailMessage subject greaseString;
                text: aWAEmailMessage body greaseString.

        client send.

in SendMail

user
        ^user

user: aString
        user := aString

password
        ^password

password: aString
        password := aString

isAuthenticated
        ^self user notNil

encodeString: aString
        | str dec out |
       
        str := String new: (aString size * 4 / 3 + 3) ceiling.
        dec := Base64MimeConverter new.
        dec
                mimeStream: (out := str writeStream);
                dataStream: aString readStream;
                mimeEncode.
                       
        ^out contents

sendAuthentication
        | rc |
        rc := self sendCrlfString: 'AUTH LOGIN ' , (self encodeString: self user).
        rc ifTrue: [ rc := self sendCrlfString: (self encodeString: self password)].
        ^rc

send
        | rc |
        ^self isEnabled
                ifFalse: [self saveToFile]
                ifTrue: [
                        rc := self openTcpConnection.
                        rc
                                ifTrue:
                                        [rc ifTrue: [rc := self readSmtpResult].
                                        rc ifTrue: [rc := self sendHelo].
                                        (rc and: [ self isAuthenticated ])
                                                ifTrue: [ rc := self sendAuthentication ].
                                        rc ifTrue: [rc := self readSmtpResult].
                                        rc ifTrue: [rc := self sendMailFrom].
                                        rc ifTrue: [rc := self readSmtpResult].
                                        rc ifTrue: [rc := self sendRcptTo].
                                        rc ifTrue: [rc := self readSmtpResult].
                                        rc ifTrue: [rc := self sendDataBeg].
                                        rc ifTrue: [rc := self readSmtpResult].
                                        rc ifTrue: [rc := self sendHeader].
                                        rc ifTrue: [rc := self sendData].
                                        rc ifTrue: [rc := self sendDataEnd].
                                        rc ifTrue: [rc := self readSmtpResult].
                                        rc ifTrue: [rc := self sendQuit].
                                        rc ifTrue: [rc := self readSmtpResult].
                        self close].
                        ^rc]
Reply | Threaded
Open this post in threaded view
|

Fwd: fixes to send mails with gemstone

EstebanLM
*bump*

Any chance this will be integrated?

Cheers,
Esteban

Inicio del mensaje reenviado:

De: Esteban Lorenzano <[hidden email]>
Fecha: 3 de marzo de 2011 12:03:32 GMT-03:00
Para: GemStone Seaside beta discussion <[hidden email]>, Dale Henrichs <[hidden email]>
Asunto: fixes to send mails with gemstone

Hi,
I made a couple of fixes to make seaside send correct emails, also using authenticated accounts.
I tweak something in

GRGemStonePlatform>>seasideDeliverEmailMessage:

and also changed SendMail to accept user and password.
Maybe this code can be integrated into gemstone?

Cheers,
Esteban

This is the code changed (I don't know how to produce a changeset in gemstone, I'm sorry)

in GRGemStonePlatform

seasideDeliverEmailMessage: aWAEmailMessage
| client |
client := SendMail new.

"user login information if applicable"
self seasideSmtpUsername ifNotNilDo: [:username |
client user: username.
self seasideSmtpPassword ifNotNilDo: [:password |
client password: password]].

"use HELO/EHLO ip address format [127.0.0.1] if local host name is ip"
(self seasideIsIpAddress: client ownDomainName)
ifTrue: [client ownDomainName: '[', client ownDomainName, ']'].

"deliver the mail"
client
mailhostName: self seasideSmtpServer;
smtpPort: self seasideSmtpPort;
from: aWAEmailMessage from address greaseString;
to: (String streamContents: [ :stream |
aWAEmailMessage recipientsAddresses
do: [ :each | stream nextPutAll: each greaseString ]
separatedBy: [ stream nextPut: $, ] ]);
subject: aWAEmailMessage subject greaseString;
text: aWAEmailMessage body greaseString.

client send.

in SendMail

user
^user

user: aString
user := aString

password
^password

password: aString
password := aString

isAuthenticated
^self user notNil

encodeString: aString
| str dec out |

str := String new: (aString size * 4 / 3 + 3) ceiling.
dec := Base64MimeConverter new.
dec
mimeStream: (out := str writeStream);
dataStream: aString readStream;
mimeEncode.

^out contents

sendAuthentication
| rc |
rc := self sendCrlfString: 'AUTH LOGIN ' , (self encodeString: self user).
rc ifTrue: [ rc := self sendCrlfString: (self encodeString: self password)].
^rc

send
| rc |
^self isEnabled
ifFalse: [self saveToFile]
ifTrue: [
rc := self openTcpConnection.
rc
ifTrue:
[rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendHelo].
(rc and: [ self isAuthenticated ])
ifTrue: [ rc := self sendAuthentication ].
rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendMailFrom].
rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendRcptTo].
rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendDataBeg].
rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendHeader].
rc ifTrue: [rc := self sendData].
rc ifTrue: [rc := self sendDataEnd].
rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendQuit].
rc ifTrue: [rc := self readSmtpResult].
self close].
^rc]

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: fixes to send mails with gemstone

Johan Brichau-2
Hi Esteban,

I also made overlapping changes to the same code. Some of those fixes preceded your email and were integrated by Dale in beta8.6 and Seaside3.0.4.
I don't know what Dale's preferred process is, but, I would be happy to integrate these changes in the corresponding GLASS packages (I have them in my local patches already).

cheers
Johan

On 08 Mar 2011, at 15:06, Esteban Lorenzano wrote:

> *bump*
>
> Any chance this will be integrated?
>
> Cheers,
> Esteban
>
> Inicio del mensaje reenviado:
>
>> De: Esteban Lorenzano <[hidden email]>
>> Fecha: 3 de marzo de 2011 12:03:32 GMT-03:00
>> Para: GemStone Seaside beta discussion <[hidden email]>, Dale Henrichs <[hidden email]>
>> Asunto: fixes to send mails with gemstone
>>
>> Hi,
>> I made a couple of fixes to make seaside send correct emails, also using authenticated accounts.
>> I tweak something in
>>
>> GRGemStonePlatform>>seasideDeliverEmailMessage:
>>
>> and also changed SendMail to accept user and password.
>> Maybe this code can be integrated into gemstone?
>>
>> Cheers,
>> Esteban
>>
>> This is the code changed (I don't know how to produce a changeset in gemstone, I'm sorry)
>>
>> in GRGemStonePlatform
>>
>> seasideDeliverEmailMessage: aWAEmailMessage
>> | client |
>> client := SendMail new.
>>
>> "user login information if applicable"
>> self seasideSmtpUsername ifNotNilDo: [:username |
>> client user: username.
>> self seasideSmtpPassword ifNotNilDo: [:password |
>> client password: password]].
>>
>> "use HELO/EHLO ip address format [127.0.0.1] if local host name is ip"
>> (self seasideIsIpAddress: client ownDomainName)
>> ifTrue: [client ownDomainName: '[', client ownDomainName, ']'].
>>
>> "deliver the mail"
>> client
>> mailhostName: self seasideSmtpServer;
>> smtpPort: self seasideSmtpPort;
>> from: aWAEmailMessage from address greaseString;
>> to: (String streamContents: [ :stream |
>> aWAEmailMessage recipientsAddresses
>> do: [ :each | stream nextPutAll: each greaseString ]
>> separatedBy: [ stream nextPut: $, ] ]);
>> subject: aWAEmailMessage subject greaseString;
>> text: aWAEmailMessage body greaseString.
>>
>> client send.
>>
>> in SendMail
>>
>> user
>> ^user
>>
>> user: aString
>> user := aString
>>
>> password
>> ^password
>>
>> password: aString
>> password := aString
>>
>> isAuthenticated
>> ^self user notNil
>>
>> encodeString: aString
>> | str dec out |
>>
>> str := String new: (aString size * 4 / 3 + 3) ceiling.
>> dec := Base64MimeConverter new.
>> dec
>> mimeStream: (out := str writeStream);
>> dataStream: aString readStream;
>> mimeEncode.
>>
>> ^out contents
>>
>> sendAuthentication
>> | rc |
>> rc := self sendCrlfString: 'AUTH LOGIN ' , (self encodeString: self user).
>> rc ifTrue: [ rc := self sendCrlfString: (self encodeString: self password)].
>> ^rc
>>
>> send
>> | rc |
>> ^self isEnabled
>> ifFalse: [self saveToFile]
>> ifTrue: [
>> rc := self openTcpConnection.
>> rc
>> ifTrue:
>> [rc ifTrue: [rc := self readSmtpResult].
>> rc ifTrue: [rc := self sendHelo].
>> (rc and: [ self isAuthenticated ])
>> ifTrue: [ rc := self sendAuthentication ].
>> rc ifTrue: [rc := self readSmtpResult].
>> rc ifTrue: [rc := self sendMailFrom].
>> rc ifTrue: [rc := self readSmtpResult].
>> rc ifTrue: [rc := self sendRcptTo].
>> rc ifTrue: [rc := self readSmtpResult].
>> rc ifTrue: [rc := self sendDataBeg].
>> rc ifTrue: [rc := self readSmtpResult].
>> rc ifTrue: [rc := self sendHeader].
>> rc ifTrue: [rc := self sendData].
>> rc ifTrue: [rc := self sendDataEnd].
>> rc ifTrue: [rc := self readSmtpResult].
>> rc ifTrue: [rc := self sendQuit].
>> rc ifTrue: [rc := self readSmtpResult].
>> self close].
>> ^rc]
>

Reply | Threaded
Open this post in threaded view
|

Re: fixes to send mails with gemstone

Dale Henrichs
In reply to this post by EstebanLM
Esteban,

Yep, I plan to:

  http://code.google.com/p/glassdb/issues/detail?id=248

I originally was going to include it in Seaside3.0.4, but the release dragged on too long so I didn't finish integrating the other fixes :(

Dale

On Mar 8, 2011, at 6:06 AM, Esteban Lorenzano wrote:

*bump*

Any chance this will be integrated?

Cheers,
Esteban

Inicio del mensaje reenviado:

De: Esteban Lorenzano <[hidden email]<mailto:[hidden email]>>
Fecha: 3 de marzo de 2011 12:03:32 GMT-03:00
Para: GemStone Seaside beta discussion <[hidden email]<mailto:[hidden email]>>, Dale Henrichs <[hidden email]<mailto:[hidden email]>>
Asunto: fixes to send mails with gemstone

Hi,
I made a couple of fixes to make seaside send correct emails, also using authenticated accounts.
I tweak something in

GRGemStonePlatform>>seasideDeliverEmailMessage:

and also changed SendMail to accept user and password.
Maybe this code can be integrated into gemstone?

Cheers,
Esteban

This is the code changed (I don't know how to produce a changeset in gemstone, I'm sorry)

in GRGemStonePlatform

seasideDeliverEmailMessage: aWAEmailMessage
| client |
client := SendMail new.

"user login information if applicable"
self seasideSmtpUsername ifNotNilDo: [:username |
client user: username.
self seasideSmtpPassword ifNotNilDo: [:password |
client password: password]].

"use HELO/EHLO ip address format [127.0.0.1] if local host name is ip"
(self seasideIsIpAddress: client ownDomainName)
ifTrue: [client ownDomainName: '[', client ownDomainName, ']'].

"deliver the mail"
client
mailhostName: self seasideSmtpServer;
smtpPort: self seasideSmtpPort;
from: aWAEmailMessage from address greaseString;
to: (String streamContents: [ :stream |
aWAEmailMessage recipientsAddresses
do: [ :each | stream nextPutAll: each greaseString ]
separatedBy: [ stream nextPut: $, ] ]);
subject: aWAEmailMessage subject greaseString;
text: aWAEmailMessage body greaseString.

client send.

in SendMail

user
^user

user: aString
user := aString

password
^password

password: aString
password := aString

isAuthenticated
^self user notNil

encodeString: aString
| str dec out |

str := String new: (aString size * 4 / 3 + 3) ceiling.
dec := Base64MimeConverter new.
dec
mimeStream: (out := str writeStream);
dataStream: aString readStream;
mimeEncode.

^out contents

sendAuthentication
| rc |
rc := self sendCrlfString: 'AUTH LOGIN ' , (self encodeString: self user).
rc ifTrue: [ rc := self sendCrlfString: (self encodeString: self password)].
^rc

send
| rc |
^self isEnabled
ifFalse: [self saveToFile]
ifTrue: [
rc := self openTcpConnection.
rc
ifTrue:
[rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendHelo].
(rc and: [ self isAuthenticated ])
ifTrue: [ rc := self sendAuthentication ].
rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendMailFrom].
rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendRcptTo].
rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendDataBeg].
rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendHeader].
rc ifTrue: [rc := self sendData].
rc ifTrue: [rc := self sendDataEnd].
rc ifTrue: [rc := self readSmtpResult].
rc ifTrue: [rc := self sendQuit].
rc ifTrue: [rc := self readSmtpResult].
self close].
^rc]


Reply | Threaded
Open this post in threaded view
|

Re: Fwd: fixes to send mails with gemstone

Dale Henrichs
In reply to this post by Johan Brichau-2
Ah yes, release process:)

How are your Metacello chops?

The current release of Grease is 1.0.4 and for GemStone-specific fixes, I would create a 1.0.4.1 version with just the GemStone package changes and then update the symbolic versions and we're off to the races ... A coordination email on this list would help avoid duplication ...

Alexandre Bergel has created a MetacelloBrowser and I ported it to OmniBrowser and I'm in the process of using it do my daily work with GLASS ... at the moment there are still some issues, but when it is ready it will be much easier to manage a configuration...

Dale

On Mar 8, 2011, at 6:47 AM, Johan Brichau wrote:

> Hi Esteban,
>
> I also made overlapping changes to the same code. Some of those fixes preceded your email and were integrated by Dale in beta8.6 and Seaside3.0.4.
> I don't know what Dale's preferred process is, but, I would be happy to integrate these changes in the corresponding GLASS packages (I have them in my local patches already).
>
> cheers
> Johan
>
> On 08 Mar 2011, at 15:06, Esteban Lorenzano wrote:
>
>> *bump*
>>
>> Any chance this will be integrated?
>>
>> Cheers,
>> Esteban
>>
>> Inicio del mensaje reenviado:
>>
>>> De: Esteban Lorenzano <[hidden email]>
>>> Fecha: 3 de marzo de 2011 12:03:32 GMT-03:00
>>> Para: GemStone Seaside beta discussion <[hidden email]>, Dale Henrichs <[hidden email]>
>>> Asunto: fixes to send mails with gemstone
>>>
>>> Hi,
>>> I made a couple of fixes to make seaside send correct emails, also using authenticated accounts.
>>> I tweak something in
>>>
>>> GRGemStonePlatform>>seasideDeliverEmailMessage:
>>>
>>> and also changed SendMail to accept user and password.
>>> Maybe this code can be integrated into gemstone?
>>>
>>> Cheers,
>>> Esteban
>>>
>>> This is the code changed (I don't know how to produce a changeset in gemstone, I'm sorry)
>>>
>>> in GRGemStonePlatform
>>>
>>> seasideDeliverEmailMessage: aWAEmailMessage
>>> | client |
>>> client := SendMail new.
>>>
>>> "user login information if applicable"
>>> self seasideSmtpUsername ifNotNilDo: [:username |
>>> client user: username.
>>> self seasideSmtpPassword ifNotNilDo: [:password |
>>> client password: password]].
>>>
>>> "use HELO/EHLO ip address format [127.0.0.1] if local host name is ip"
>>> (self seasideIsIpAddress: client ownDomainName)
>>> ifTrue: [client ownDomainName: '[', client ownDomainName, ']'].
>>>
>>> "deliver the mail"
>>> client
>>> mailhostName: self seasideSmtpServer;
>>> smtpPort: self seasideSmtpPort;
>>> from: aWAEmailMessage from address greaseString;
>>> to: (String streamContents: [ :stream |
>>> aWAEmailMessage recipientsAddresses
>>> do: [ :each | stream nextPutAll: each greaseString ]
>>> separatedBy: [ stream nextPut: $, ] ]);
>>> subject: aWAEmailMessage subject greaseString;
>>> text: aWAEmailMessage body greaseString.
>>>
>>> client send.
>>>
>>> in SendMail
>>>
>>> user
>>> ^user
>>>
>>> user: aString
>>> user := aString
>>>
>>> password
>>> ^password
>>>
>>> password: aString
>>> password := aString
>>>
>>> isAuthenticated
>>> ^self user notNil
>>>
>>> encodeString: aString
>>> | str dec out |
>>>
>>> str := String new: (aString size * 4 / 3 + 3) ceiling.
>>> dec := Base64MimeConverter new.
>>> dec
>>> mimeStream: (out := str writeStream);
>>> dataStream: aString readStream;
>>> mimeEncode.
>>>
>>> ^out contents
>>>
>>> sendAuthentication
>>> | rc |
>>> rc := self sendCrlfString: 'AUTH LOGIN ' , (self encodeString: self user).
>>> rc ifTrue: [ rc := self sendCrlfString: (self encodeString: self password)].
>>> ^rc
>>>
>>> send
>>> | rc |
>>> ^self isEnabled
>>> ifFalse: [self saveToFile]
>>> ifTrue: [
>>> rc := self openTcpConnection.
>>> rc
>>> ifTrue:
>>> [rc ifTrue: [rc := self readSmtpResult].
>>> rc ifTrue: [rc := self sendHelo].
>>> (rc and: [ self isAuthenticated ])
>>> ifTrue: [ rc := self sendAuthentication ].
>>> rc ifTrue: [rc := self readSmtpResult].
>>> rc ifTrue: [rc := self sendMailFrom].
>>> rc ifTrue: [rc := self readSmtpResult].
>>> rc ifTrue: [rc := self sendRcptTo].
>>> rc ifTrue: [rc := self readSmtpResult].
>>> rc ifTrue: [rc := self sendDataBeg].
>>> rc ifTrue: [rc := self readSmtpResult].
>>> rc ifTrue: [rc := self sendHeader].
>>> rc ifTrue: [rc := self sendData].
>>> rc ifTrue: [rc := self sendDataEnd].
>>> rc ifTrue: [rc := self readSmtpResult].
>>> rc ifTrue: [rc := self sendQuit].
>>> rc ifTrue: [rc := self readSmtpResult].
>>> self close].
>>> ^rc]
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: fixes to send mails with gemstone

Dale Henrichs
Oh and glassdb bug reports for the issues being addressed so we have a
record...

Dale

On 03/08/2011 08:41 AM, Dale Henrichs wrote:

> Ah yes, release process:)
>
> How are your Metacello chops?
>
> The current release of Grease is 1.0.4 and for GemStone-specific fixes, I would create a 1.0.4.1 version with just the GemStone package changes and then update the symbolic versions and we're off to the races ... A coordination email on this list would help avoid duplication ...
>
> Alexandre Bergel has created a MetacelloBrowser and I ported it to OmniBrowser and I'm in the process of using it do my daily work with GLASS ... at the moment there are still some issues, but when it is ready it will be much easier to manage a configuration...
>
> Dale
>
> On Mar 8, 2011, at 6:47 AM, Johan Brichau wrote:
>
>> Hi Esteban,
>>
>> I also made overlapping changes to the same code. Some of those fixes preceded your email and were integrated by Dale in beta8.6 and Seaside3.0.4.
>> I don't know what Dale's preferred process is, but, I would be happy to integrate these changes in the corresponding GLASS packages (I have them in my local patches already).
>>
>> cheers
>> Johan
>>
>> On 08 Mar 2011, at 15:06, Esteban Lorenzano wrote:
>>
>>> *bump*
>>>
>>> Any chance this will be integrated?
>>>
>>> Cheers,
>>> Esteban
>>>
>>> Inicio del mensaje reenviado:
>>>
>>>> De: Esteban Lorenzano<[hidden email]>
>>>> Fecha: 3 de marzo de 2011 12:03:32 GMT-03:00
>>>> Para: GemStone Seaside beta discussion<[hidden email]>, Dale Henrichs<[hidden email]>
>>>> Asunto: fixes to send mails with gemstone
>>>>
>>>> Hi,
>>>> I made a couple of fixes to make seaside send correct emails, also using authenticated accounts.
>>>> I tweak something in
>>>>
>>>> GRGemStonePlatform>>seasideDeliverEmailMessage:
>>>>
>>>> and also changed SendMail to accept user and password.
>>>> Maybe this code can be integrated into gemstone?
>>>>
>>>> Cheers,
>>>> Esteban
>>>>
>>>> This is the code changed (I don't know how to produce a changeset in gemstone, I'm sorry)
>>>>
>>>> in GRGemStonePlatform
>>>>
>>>> seasideDeliverEmailMessage: aWAEmailMessage
>>>> | client |
>>>> client := SendMail new.
>>>>
>>>> "user login information if applicable"
>>>> self seasideSmtpUsername ifNotNilDo: [:username |
>>>> client user: username.
>>>> self seasideSmtpPassword ifNotNilDo: [:password |
>>>> client password: password]].
>>>>
>>>> "use HELO/EHLO ip address format [127.0.0.1] if local host name is ip"
>>>> (self seasideIsIpAddress: client ownDomainName)
>>>> ifTrue: [client ownDomainName: '[', client ownDomainName, ']'].
>>>>
>>>> "deliver the mail"
>>>> client
>>>> mailhostName: self seasideSmtpServer;
>>>> smtpPort: self seasideSmtpPort;
>>>> from: aWAEmailMessage from address greaseString;
>>>> to: (String streamContents: [ :stream |
>>>> aWAEmailMessage recipientsAddresses
>>>> do: [ :each | stream nextPutAll: each greaseString ]
>>>> separatedBy: [ stream nextPut: $, ] ]);
>>>> subject: aWAEmailMessage subject greaseString;
>>>> text: aWAEmailMessage body greaseString.
>>>>
>>>> client send.
>>>>
>>>> in SendMail
>>>>
>>>> user
>>>> ^user
>>>>
>>>> user: aString
>>>> user := aString
>>>>
>>>> password
>>>> ^password
>>>>
>>>> password: aString
>>>> password := aString
>>>>
>>>> isAuthenticated
>>>> ^self user notNil
>>>>
>>>> encodeString: aString
>>>> | str dec out |
>>>>
>>>> str := String new: (aString size * 4 / 3 + 3) ceiling.
>>>> dec := Base64MimeConverter new.
>>>> dec
>>>> mimeStream: (out := str writeStream);
>>>> dataStream: aString readStream;
>>>> mimeEncode.
>>>>
>>>> ^out contents
>>>>
>>>> sendAuthentication
>>>> | rc |
>>>> rc := self sendCrlfString: 'AUTH LOGIN ' , (self encodeString: self user).
>>>> rc ifTrue: [ rc := self sendCrlfString: (self encodeString: self password)].
>>>> ^rc
>>>>
>>>> send
>>>> | rc |
>>>> ^self isEnabled
>>>> ifFalse: [self saveToFile]
>>>> ifTrue: [
>>>> rc := self openTcpConnection.
>>>> rc
>>>> ifTrue:
>>>> [rc ifTrue: [rc := self readSmtpResult].
>>>> rc ifTrue: [rc := self sendHelo].
>>>> (rc and: [ self isAuthenticated ])
>>>> ifTrue: [ rc := self sendAuthentication ].
>>>> rc ifTrue: [rc := self readSmtpResult].
>>>> rc ifTrue: [rc := self sendMailFrom].
>>>> rc ifTrue: [rc := self readSmtpResult].
>>>> rc ifTrue: [rc := self sendRcptTo].
>>>> rc ifTrue: [rc := self readSmtpResult].
>>>> rc ifTrue: [rc := self sendDataBeg].
>>>> rc ifTrue: [rc := self readSmtpResult].
>>>> rc ifTrue: [rc := self sendHeader].
>>>> rc ifTrue: [rc := self sendData].
>>>> rc ifTrue: [rc := self sendDataEnd].
>>>> rc ifTrue: [rc := self readSmtpResult].
>>>> rc ifTrue: [rc := self sendQuit].
>>>> rc ifTrue: [rc := self readSmtpResult].
>>>> self close].
>>>> ^rc]
>>>
>>
>