|Subject:||Re: IdSMTP - Connection Closed Gracefully|
|Posted by:||Remy Lebeau \(Indy Team\) (firstname.lastname@example.org)|
|Date:||Sun, 13 Dec 2009|
"Alan T" <alan_NO_SPAM_plt…@yahoo.com.au> wrote in message
> My client got this error:
> Connection Closed Gracefully.
That means the server is closing the connection on its end.
> These are the code:
You should be calling Connect() outside of the try..finally block, not
inside of it, ie:
> If this happened in StaffIdSMTP.Connect;
> we should have socket error, but no socket error.
Then you are actually connecting to a valid server, but there are many
reasons why Send() would fail afterwards. Maybe you connected to the wrong
type of server (such as by using the wrong port) and it did not understand
the SMTP data being sent to it. Maybe you connected to a valid SMTP server,
but it was already at its max connections limit and disconnected you
immediately. Maybe the server accepted your connection, but had an internal
error and had no choice but to disconnect you.
> So the application looked was able to connect but not able to send.
That is exactly what is happening.
Remy Lebeau (Indy Team)
IdSMTP - Connection Closed Gracefully posted by Alan T on Mon, 14 Dec 2009