QtmmSendMail API
You can use the Send MIME Mail (QtmmSendMail)
API to send e-mail from an i5/OS® program.
The QtmmSendMail API supports sending multiple mail attachments at one time, but the Send Distribution (SNDDST) command does not. This API is in the service program QTCP/QTMMSNDM. Application programs must bind to this service program.
The QtmmSendMail API works in the following ways:
- You create an ASCII file with an entire MIME note. The headers are all in US-ASCII coded character set identifier (CCSID) 367.
- 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
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:
Required parameter group
- File name
- (Input Char(*)) 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
- (Input Binary(4)) 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)
- (Input Char(*)) The character string of an SMTP originator address; for example, smith@myhost.mytown.com. All SMTP addresses should be in coded character set identifier (CCSID) 500.
- Length of originator
- (Input Binary(4)) 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
- (Input Binary(4)) 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
This table shows the layout for format ADDT0100.
Offset Dec
| Offset Hex
| Type
| Field
| Field description |
0
| 0
| BINARY(4)
| 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.
|
4
| 4
| BINARY(4)
| Address length
| The length in bytes of the SMTP address. The maximum length is 256 bytes. This maximum length is determined by Internet standards.
|
8
| 8
| CHAR(8)
| Address Format name
| The characters that identify the particular structure. (Current value ADDT0100). It is used for level control of the structure.
|
16
| 10
| BINARY(4)
| Distribution type
| The type of recipient. Possible values are:
- 0 Normal
- 1 Carbon copy
- 2 Blind carbon copy
|
20
| 14
| BINARY(4)
| Reserved
| This field is reserved and must be set to 0.
|
|
| CHAR(*)
| Address
| The actual SMTP address (no NULLS included). All SMTP addresses should be in CCSID 500. |
Parent topic:
Sending and receiving e-mail
Related concepts
Solving problems with the QtmmSendMail API Attaching files