Sun Java System Messaging Server 6 2005Q4 MTA Developer's Reference

To, Cc, and Bcc Addresses

The list of To:, Cc:, and Bcc: addresses to send a message to is built up, one address at a time, with item-list entries. Each item-list entry specifies the type of address (To:, Cc:, or Bcc:) and a string containing the address.

The type of address is denoted by the item code, MTA_TO, MTA_CC, or MTA_BCC, associated with the item-list entry. The mtaSend() routine uses this information to build the message envelope To: address list and To:, Cc:, and Bcc: header.

To specify an envelope-only address that should not appear in the message header (for example, an active transport address), use MTA_ENV_TO. Likewise, to specify a header-only address that should not appear in the envelope, such as, an inactive address, use MTA_HDR_TO, MTA_HDR_CC, or MTA_HDR_BCC, as appropriate.

When one or more of the To:, Cc:, or Bcc: addresses is illegal, the mtaSend() routine will not, by default, indicate which addresses were in error. However, the differentiation can be achieved by using the MTA_ADR_STATUS item code. When this item code is used, the item_status field associated with an address will be set either to zero (0) if the address was accepted, or to a non-zero value if there was an error processing the address.

When item_status is zero, item_smessage points to a NULL terminated string containing the rewritten form of the address. When item_status has a non-zero value, item_smessage points to a NULL terminated string containing an error message suitable for printing for diagnostic purposes.