tfSmtpUserDisconnect
Table of Contents >> Optional Protocols >> SMTP
#include <trsocket.h> |
int tfSmtpUserDisconnect | (ttSmtpClientHandle smtpClientHandle); |
Function Description
This function disconnects from the SMTP server. It should be called when a mail message has been sent and no other mail messages are going to be sent for at least a short while.
If the session is blocking, the indication of a successful mail message delivery is when tfSmtpUserSendEom() returns TM_ENOERROR.
If the session is non-blocking, the indication of a successful mail message delivery is when the event TM_SMTP_EVENT_EOM_ACK is received.
In non-blocking mode, a successful reply to the client's QUIT command will generate a TM_SMTP_EVENT_DISCONNECTED event to your SMTP event callback function.
Parameters
- smtpClientHandle
- The SMTP client session handle as returned by tfSmtpUserNewSession().
Returns
- TM_ENOERROR
- Success.
- TM_EINVAL
- Invalid SMTP client session handle.
- TM_EINPROGRESS
- The operation is in progress (non-blocking mode only). Call tfSmtpUserExecute() periodically until complete.
- TM_ESERVERPERM
- The server rejected the command with a permanent negative completion reply (5xx status code, see RFC 5321).
- TM_ESERVERTEMP
- The server rejected the command with a transient negative completion reply (4xx status code, see RFC 5321).
- TM_ESERVERSYNC
- The client and server are out of sync and cannot proceed; the session has been disconnected. This can occur, for example, if the server unexpectedly sends an intermediate reply (3xx status code, see RFC 5321) to a command that requires a completion code.
- TM_ETIMEDOUT
- The Treck SMTP client timed out and disconnected while waiting for a reply from the server. The time limit is set via tfSmtpUserNewSession().
- other errors