Each message sent with mtaSend() must have a corresponding item list describing the message. The entries in this item list specify the message’s From: and To: addresses as well as input sources for the content of the message.
The basic steps in sending a message with mtaSend() are:
Build an item list to pass to mtaSend().
To build an item list, complete the following steps:
Specify any special processing options, such as MTA_BLANK, or MTA_IGNORE_ERRORS.
Specify the message’s envelope From: address with the MTA_USER item.
Specify the message’s To:, Cc:, and Bcc: addresses with the MTA_TO, MTA_CC, and MTA_BCC items.
Specify an initial message header in one of two ways:
Specify an input source that supplies each of the initial message header lines ( MTA_HDR_FILE, MTA_HDR_PROC).
Specify the content of individual message header lines with individual item codes ( MTA_SUBJECT, MTA_HDR_LINE).
Specify the input sources for the message body with the MTA_MSG_FILE or MTA_MSG_PROC items.
Terminate the item list with an item code of value 0 (MTA_END_LIST).
Pass the item list to mtaSend().
Check the return status from mtaSend().
For a description of all item codes and their return status values, see Chapter 8, mtaSend() Routine Specification.
To enqueue additional messages, simply repeat these steps.