tfSmtpUserSendBom

Jump to: navigation, search

Table of Contents >> Optional Protocols >> SMTP


#include <trsocket.h>


int tfSmtpUserSendBom (
ttSmtpClientHandle smtpClientHandle,
char * subjectPtr,
char * dateTimePtr,
ttUser8Bit flags
);


Function Description

This function indicates to the server that a new message will be sent. 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 tfSmtpUserSendRecipientInfo() returns 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_RECIPIENT_ACK is received.

In non-blocking mode, a successful reply from the server will generate a TM_SMTP_EVENT_BOM_ACK event to your SMTP event callback function.


Parameters

  • smtpClientHandle
    The SMTP client session handle as returned by tfSmtpUserNewSession().
  • subjectPtr
    A pointer to a string that holds the mail message subject. This pointer can be NULL.
  • dateTimePtr
    A pointer to a string that holds the current date and time. If this parameter is NULL, Treck will call tfKernelGetSystemTime().
  • flags
    Flags supported:
  • TM_SMTP_FLAG_MIME: Indicates that the mail is MIME encoded. All MIME encoded mail must have this flag set, otherwise the message will be unreadable.


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.
  • 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
    Some socket errors returned from the SMTP client's calls to send() and recv() are passed directly to the caller.


Table of Contents >> Optional Protocols >> SMTP