Disconnect()
sends a QUIT
command to the server by default, which will fail if the connection has already been lost. If you are calling Disconnect()
after a previous socket error occurred, pass false to the ANotifyPeer
parameter of Disconnect()
to bypass the QUIT command:
POP3Client.Disconnect(false);
Do note that bypassing the QUIT
prevents the server from entering the UPDATE state, so if you had previously called Delete()
then those messages will not be removed from the server, as deletion only occurrs during the UPDATE state. Use ANotifyPeer=false
only during error handling, use ANotifyPeer=true
during normal operation.