This utility provides also a way to send customized letters.
By "customized letter" we mean a MIME file including
in the text some "output variables".
The idea is that a regular ILE-RPG program would read a
database file (for instance a customer file) and - if some
criteria are met - it would
- substitute variables in the MIME file
- send this "customized" MIME file to the appropriate e-mail.
Of course, to implement such a program, it takes
- a "control file" (e.g. a customer file, including
a contact name and e-mail for each customer record)
- a MIME file containing substitution variables
- some program logic, by which, if conditions are met,
a subprocedure of our service program would be called to
- create a temporary copy of the MIME file,
where each output variable is substituted
with the proper value
- send the MIME file to the appropriate e-mail address
provides a sample case, where
This is how you run it.
- you make entries in a pseudo customer file
- you run a sample program
(member custmail in
that takes advantage from some service program subprocedures
to accomplish the job.
Figure 1- Updating the pseudo customer file
Before launching the program that will send customized letters,
you've better to insert your name and your e-mail address,
so that you can receive a letter.
Figure 2- Customer file updated
You may use F23 to clear the customer file, before adding
your own data. By doing this, you would not annoy other people.
Next you are requested to enter some sender's data:
Figure 3- Sender's data
As soon as you press Enter, the custmail
sample program, would, for each "customer"
- produce a customized copy of the MIME file
- address this copy to the customer e-mail
Figure 3- Customized letters were sent
Note. You should look to
member custmail in
to understand how this is accomplished.