Hello!
I'm trying to send an email with SMTPClient.
It always stop with timeout here (Data receive timed out):
*waitForDataFor: timeout "Wait for the given nr of seconds for data to
arrive. Signal a time out or connection close exception if either
happens before data becomes available." ^self waitForDataFor:
timeout ifClosed: [ConnectionClosed signal: 'Connection closed while
waiting for data.'] ifTimedOut: [ConnectionTimedOut signal: 'Data
receive timed out.']*
Test code from the Playground is at the end.
The server is Exchange. I've tested with bare hand telnet connection, it
works well. I was able to create email through telnet and send it.
But the SMTPClient in pharo always runs to timeout.
Others:
last message in SMTPClient ( firstLine := self stream nextLine. I saw in
debugger)
fetchNextResponse
"The FTP and similar protocols allow multi-line responses.
If the response is multi-line, the fourth character of the first line
is a
$- and the last line repeats the numeric code but the code is followed
by
a space."
| response result firstLine |
result := '' writeStream.
* firstLine := self stream nextLine.* [....
*]*
Last response from server: (lastResponse instance variable):
*354 Start mail input; end with <CRLF>.<CRLF>* (copied from debugger)
This is why I forced CRLF... at the end of the message....
It seems to wait a response after sending the data....
Is there any idea what else to check?
Thanks: Robert
------------------------------------ Playground code (yes, port 26)
*SMTPClient* deliverMailFrom: 'info(a)sender.hu' to: #('
laszlo.gombas(a)recipient.hu') text:
'
To: <info(a)sender.hu>
From: <laszlo.gombas(a)recipient.hu>
Subject: this is a test
Hello!
ÃRVÃZTŰRÅ TÃKÃRFÃRÃGÃP
',Character cr asString,Character lf asString,'.'
,Character cr asString,Character lf asString
usingServer: '10.0.0.31:26'.