tfSmtpUserSendSenderInfo
Table of Contents >> Optional Protocols >> SMTP
| #include <trsocket.h> |
| int tfSmtpUserSendSenderInfo | ( |
| ttSmtpClientHandle smtpClientHandle, | |
| char * senderNamePtr, | |
| char * senderAddrPtr, | |
| char * replyToNamePtr, | |
| char * replyToAddrPtr | |
| ); |
Function Description
This function sends the sender's name and address. The senderNamePtr and replyToNamePtr parameters are optional and could be NULL. This API needs to be called in the right state, otherwise, TM_EPERM will be returned. If the session is blocking, it should be called after tfSmtpUserConnect() has returned TM_ENOERROR and no other API has been called. If the session is non-blocking, it should be called when the event TM_SMTP_EVENT_CONNECTED is received.In non-blocking mode, a successful reply from the server will generate a TM_SMTP_EVENT_SENDER_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().
- senderNamePtr
- A pointer to a string that holds the sender's name, e.g. "Bob Smith". This pointer can be NULL.
- senderAddrPtr
- A pointer to a string that holds the sender's address, e.g. "bob@foo.com".
- replyToNamePtr
- A pointer to a string that holds the reply-to name, e.g. "Alice Smith". This pointer can be NULL.
- replyToAddrPtr
- A pointer to a string that holds the reply-to address, e.g. "alice@bar.com". This pointer can be NULL.
Returns
- TM_ENOERROR
- Success.
- TM_EINVAL
- Invalid SMTP client session handle or other input parameter.
- TM_EPERM
- The SMTP session is not connected.
- TM_ENOBUFS
- Insufficient resources to complete the operation.
- 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