tfSmtpUserSendNoop
Table of Contents >> Optional Protocols >> SMTP
| #include <trsocket.h> |
| int tfSmtpUserSendNoop | (ttSmtpClientHandle smtpClientHandle); |
Function Description
Send a no operation SMTP command (NOOP) to a server and get the reply. This command may be sent in any connected state that is not waiting for a completion response from the server. Since SMTP servers usually disconnect if a session is idle for too long, sending a NOOP command periodically may allow an idle session to remain connected longer.In non-blocking mode, a successful reply from the server will generate a TM_SMTP_EVENT_NOOP_ACK event to your SMTP event callback function. An unsuccessful reply from the server results in a TM_SMTP_EVENT_SERVER_ERROR or TM_SMTP_EVENT_SERVER_RETRY event. If the client times out (see tfSmtpUserNewSession()) waiting for the server to respond, a TM_SMTP_EVENT_TIMEOUT event is reported.
Parameters
- smtpClientHandle
- The SMTP client session handle as returned by tfSmtpUserNewSession().
Returns
- TM_ENOERROR
- Success.
- TM_EINVAL
- Invalid SMTP client session handle.
- TM_EPERM
- The SMTP session is not connected.
- 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().
- TM_ESHUTDOWN
- The server closed the connection, unexpectedly.
- other errors