Send MIME Mail (QtmmSendMail) API

  Required Parameter Group:

  Service Program Name: QTCP/QTMMSNDM

  Default Public Authority: *USE

  Threadsafe: No

You can use the Send MIME Mail (QtmmSendMail) API to send e-mail from an IBM® i program. The QtmmSendMail API supports sending multiple mail attachments at one time, but the Send Distribution (SNDDST) command does not.

The QtmmSendMail API works in the following way:

  1. You create an ASCII file with an entire MIME note. The headers are all in US-ASCII coded character set identifier (CCSID) 367.
  2. The application calls the QtmmSendMail API and gives it both the name of the file and the addresses that the framework and SMTP must use to forward the e-mail.

Authorities and Locks

The MIME integrated-file-system file must exist for the duration of the QMSF framework pass. The conversion and delivery exit points that are called by the QMSF job must be able to read this file. A built-in exit program removes (unlinks) the link. If this is the last link, the framework deletes the file.

Directory authority
The data authority must be *X for product QMSF.

File authority
QTCP and QMSF must have data authority *RWX and object authority *ALL.

Required Parameter Group

File name

The character string of the integrated-file-system file name of the ASCII MIME note. You must specify the entire path. After the framework finishes processing the file, it unlinks the file. If this is the last link, the framework deletes the file. This file must contain an Internet-ready MIME note that adheres to the standards that are called Request for Comment (RFC).

Length of file name

The number of bytes in the file name (the absolute path name). The maximum length is 255 bytes (no NULL that is assumed at the end).

Originator address (SMTP)

The character string of an SMTP originator address; for example, All SMTP addresses should be in coded character set identifier (CCSID) 500.

Length of originator

The length of the originator address string (not including any NULL). The maximum length is 256 bytes.

First recipient address (SMTP)
INPUT; ADDT0100(*)

The first address structure that contains a recipient address. All SMTP addresses should be in CCSID 500.

Total number of recipients

The number of recipient address structures (there must be at least one).

Error code
I/O; CHAR(*)

The structure that returns error information.

ADDTO100 Format

For detailed descriptions of the fields, see Field Descriptions.

Field Descriptions

Offset to next address structure. The number of bytes from the beginning of this address structure to the beginning of the next one. It must be at least the size of the fixed part of this address structure and the recipient address length.

Address length. The length in bytes of the SMTP address. The maximum length is 256 bytes. This maximum length is determined by Internet standards.

Address Format name. The characters that identify the particular structure. (Current value ADDT0100). It is used for level control of the structure.

Distribution type. The type of recipient. Possible values are:

Reserved. This field is reserved and must be set to 0.

Address. The actual SMTP address (no NULLs included). All SMTP addresses should be in CCSID 500.

Error Messages

API introduced: V4R1

[ Back to top | Office APIs | APIs by category ]