The sources of the coding examples are available in the following source files:
The related objects are available in library MMAIL, while sample files are made available in library MMAILDATA.
This allows you to use the samples as they are. Never change samples in library MMAIL,
as they are refreshed in any subsequent MMAIL release.
If you need to replicate a sample in some library of yours, in order to customize it to your needs,
you should not only copy and compile the related sources, but you should also populate your library with the MMAIL
objects (service programs, etc.) needed for execution. This can be done through command
The following coding examples are available
- Sending a message to a distribution list
- Dynamic EML... command in a CL program
- Dynamic EMLSTMF command in a CL program
- Retrieving info about the last e-mail message sent
Sending a message to a distribution list
This example allows to send to a given distribution list, documented in file DSTRLISTS,
a text written on an IFS stream file, and optionally another stream file as attachment.
The sender's data (name and e-mail) must be documented in file SENDERIDS.
The program can sends a separate personal message to each addressee in the distribution list,
or a single message to all the people in the distribution list, depending on parameter DSTTYPE in command MMAIL/EMLDST.
Dynamic EML... command in a CL program
Many people are asking how to build and execute a MMAIL/EML... command in a CL program.
See this example.
Dynamic EMLSTMF command in a CL program
In another case, a developer was asking how to build and execute an EMLSTMF command in a CL program.
See this example.
Retrieving info about the last e-mail message sent
Every time a mail message is sent from a MMAIL/EML... command using the QtmmSendMail system API, the following job environment variables are made available:
See an RPG example of retrieving those environment variables.
||E-mail message IFS file
||Sender e-mail address
||Semicolon separated list of recipients e-mail addresses
|| Your last order to GBTOYS|
||Date and time when message was sent
|| Wed, 21 Jul 2021 14:32:40 +0000|