Skip to main content  
  Easy400   |       iSeries home   |   RSS feed
Freeware
 
Introduction
5250 utility
Windows utility
Other utilities
    Infoprint Server
Service program
Sample code
Commands
CGI support
FAQ
WEBMail
Self maintenance
 
Download
 
 

 
Search   
iSeries MIME & Mail
Other utilities

On request of some "MIME & Mail" users, some helpful utilies have been made available and are documented in this page. These utilities are invoked through commands, which make their use in programs very easy. They are also rather straight forward coded, can be easily read, and provide a simple way to understand how mmail/sendmail service program subprocedures can be invoked.

You may also access these utilities through a menu: go mmail/mail .

Important note on commands
In order to be properly executed, all the following commands need the MMAIL library (or its clone library) be in the job library list.

  1. E-mail a simple message
  2. E-mail source members
  3. E-mail spool files
  4. E-mail save files
  5. 
E-mail stream files
E-mail a HTML stream file
  6. Send a MIME file
  7. Automated e-mailing of spool files
  7a. Automated e-mailing of spool files, Version 2
  8. Automated e-mailing of PDFs
  9. Default message body for EML... commands
10. Resend failed MIME messages
11. Converting spool files to PDF
12. Logging messages
13. Manage spool files
14. WEB utilities




  1. E-mail a simple message

Command MMAIL/EMLMSG allows to e-mail the text from a source file member as a plain message to a maximum of 50 receivers.

Command MMAIL/EMLMSG
                         E-mail simple message (EMLMSG)

 Type choices, press Enter.

 'Subject'  . . . . . . . . . . .   ___________________________________________
____________________________________
                                    ______________________________
 'Sender's name'  . . . . . . . .   ______________________________
 'Sender's e-mail address'  . . .   ______________________________
 Recipients . . . . . . . . . . .   ____        *TO, *CC, *BCC
   'name' . . . . . . . . . . . .     _____________________________________
   'e-mail address' . . . . . . .     _____________________________________
                + for more values   ____
 Text source file . . . . . . . .   *DFT____    Name, *DFT
   Library  . . . . . . . . . . .     *LIBL____ Name, *LIBL, *CURLIB
 Text source member . . . . . . .   ________    Name
 Importance . . . . . . . . . . .   *MED        *LOW, *MED, *HIG
 Priority . . . . . . . . . . . .   *NRM        *NUR, *NRM, *URG
 Sensitivity  . . . . . . . . . .   *NRM        *NRM, *PRS, *PRV, *CNF
 'Reply-to e-mail address'  . . .   *FROMADDR______________________________
 Return receipt . . . . . . . . .   *NO_        *NO, *YES
 Save directory . . . . . . . . .   /mmail/history__________________________
 Preformatted message body  . . .   N           N, Y

Subject: Subject of the message
Sender's name: Name of the person sending the message (see Note 3 below)
Sender's address: E-mail address of the person sending the message (see Note 3 below)
Recipients: up to 50 recipients can be specified; for each recipient the following must be given:
  • destination type: *TO, *CC, or *BCC
  • recipient name, within quotes
  • e-mail address, within quotes
Text source file: qualified name of the source file with the member containing the text to be e-mailed. If '*DFT' specified, library name and text source member name need not be specified: a QTEMP source file is generated and a default member name is assigned. *DFT is not supported in batch execution.
Text source member: name of the source member containing the text to be sent with the message.
Importance: *LOW=low, *MED=medium, *HIG=high
Priority: *NUR=non-urgent, *NRM=normal, *URG=urgent
Sensitivity: *NRM=normal, *PRS=personal, *PRV=private, *CNF=confidential
(use command mmail/setconfid to set the confidentiality statement).
Reply-to e-mail address: E-mail address of the person to receive reply messages, if different from the sender
Return receipt: whether a receipt should be returned to the sender when the recipient opens the message.
Save directory: IFS directory to contain a copy of the e-mailed MIME file, or *NONE .
Preformatted message body: Whether the message body should be presented as preformatted text. A preformatted text is a text where all characters (including spaces) have the same width. Examples are texts including text tables (not html tables, of course).

Example:

MMAIL/EMLMSG SUBJECT('Announcement of a new software') FROMNAME('John Evans') FROMADDR('jevans@mail.com') TO('dooley@superstar.com'/'Tom Dooley'/*TO) TXTF(QGPL/MESSAGES) TXTMBR(MSG705) RECEIPT(*YES)

Note 1. This command can run both in the interactive and in the batch environment.
Note 2. When running interactive, the source member is edited prior to sending the message.
Note 3- Fetching sender's name and e-mail from the system distribution directory
If the current user profile is enrolled in the system distribution directory (you may use command WRKDIRE to check it out) and its directory entry specifies a full name and an e-mail address (use F19 and check fields titled "SMTP user ID" and "SMTP domain"), then the sender's name and e-mail address are automatically fetched into command parameters FROMNAME and FROMEMAIL when the command is prompted.
(Command WRKNAMSTP, alias table type = system, provides another way to display / maintain e-mail addresses)
If the command is executed without prompting, to obtain the same you must specify FROMNAME(*DIRENT) FROMEMAIL(*DIRENT). In this case, if the required information cannot be retrieved from the system distribution directory entry for the current user profile, an escape message is issued.
Example:
MMAIL/EMLMSG SUBJECT('Announcement of a new software') FROMNAME(*DIRENT) FROMADDR(*DIRENT) TO('dooley@superstar.com'/'Tom Dooley'/*TO) TXTF(QGPL/MESSAGES) TXTMBR(MSG705) RECEIPT(*YES)




  2. E-mail source members

Command MMAIL/EMLSRCM allows to e-mail a message attaching up to 30 source members. Optionally, a message body may be built from another text source member. The message can be e-mailed up to 50 receivers.

Command MMAIL/EMLSRCM
                         E-mail source members (EMLSRCM)

 Type choices, press Enter.

 'Subject'  . . . . . . . . . . .   ____________________________________________
____________________________________
                                    ______________________________
 'Sender's name'  . . . . . . . .   ______________________________
 'Sender's e-mail address'  . . .   ______________________________
 Recipients . . . . . . . . . . .   ____        *TO, *CC, *BCC
   'name' . . . . . . . . . . . .     _____________________________________
   'e-mail address' . . . . . . .     _____________________________________
                + for more values   ____
 Source member to be attached . .   __________    Name
   source file  . . . . . . . . .     __________  Name
   library  . . . . . . . . . . .     *LIBL_____  Name, *LIBL, *CURLIB
                + for more values   __________
 Source mbr for message body  . .   *NONE_____    Name, *DFT, *NONE
   source file  . . . . . . . . .     __________  Name
   library  . . . . . . . . . . .     *LIBL_____  Name, *LIBL, *CURLIB
 Edit message body src mbr  . . .   *NO_          *NO, *YES
 Importance . . . . . . . . . . .   *MED        *LOW, *MED, *HIG
 Priority . . . . . . . . . . . .   *NRM        *NUR, *NRM, *URG
 Sensitivity  . . . . . . . . . .   *NRM        *NRM, *PRS, *PRV, *CNF
 'Reply-to e-mail address'  . . .   *FROMADDR______________________________
 Return receipt . . . . . . . . .   *NO_        *NO, *YES
 Save directory . . . . . . . . .   /mmail/history__________________________
 Preformatted message body  . . .   N           N, Y

Subject: Subject of the message
Sender's name: Name of the person sending the message
Sender's address: E-mail address of the person sending the message
Recipients: up to 50 recipients can be specified; for each recipient the following must be given:
  • destination type: *TO, *CC, or *BCC
  • recipient name, within quotes
  • e-mail address, within quotes
Source member to be attached: up to 30 attachments can be specified; for each attachment the following must be given:
  • source member name
  • source file name
  • source library name
Source mbr for message body: member, file, and library name for the text to become the body of the message.
If *NONE specified, the message will have no body, just the attachment will be there.
If '*DFT' specified, library name and text source member name need not be specified: a QTEMP source file is generated and a default member name is assigned. *DFT is not supported in batch execution.
Edit message body src mbr: whether the source member for the message body should be edited (interactive job only). Editing is performed via STRSEU (if available), otherwise via EDTF.
Importance: *LOW=low, *MED=medium, *HIG=high
Priority: *NUR=non-urgent, *NRM=normal, *URG=urgent
Sensitivity: *NRM=normal, *PRS=personal, *PRV=private, *CNF=confidential
(use command mmail/setconfid to set the confidentiality statement).
Reply-to e-mail address: E-mail address of the person to receive reply messages, if different from the sender
Return receipt: whether a receipt should be returned to the sender when the recipient opens the message.
Save directory: IFS directory to contain a copy of the e-mailed MIME file, or *NONE .
Preformatted message body: Whether the message body should be presented as preformatted text. A preformatted text is a text where all characters (including spaces) have the same width. Examples are texts including text tables (not html tables, of course).

Note 1. This command can run both in the interactive and in the batch environment.
Note 2- Fetching sender's name and e-mail from the system distribution directory
See Note 3 for command EMLMSG.

Example:

MMAIL/EMLSRCM SUBJECT('Source of command MMAIL/EMLSRCM')
FROMNAME('John Evans') FROMADDR('jevans@mail.com')
TO('dooley@superstar.com'/'Tom Dooley'/*TO)
SRCM(MMAIL/QCMDSRC/EMLSRM)




  3. E-mail spool files

Three similar commands are available. They differ in the way the PDF conversion utility is selected.

  • MMAIL/EMLSPL
    This command selects the PDF conversion utility defined by command MMAIL/CVTTOPDF, and lets you define a single name for all the attached PDF's.
  • MMAIL/EMLSPL2
    This command selects the PDF conversion utility defined by command MMAIL/CVTTOPDF, and lets you define a name for each attachment.
  • MMAIL/EMLSPLX
    This command, though defaulting to the PDF conversion utility selected by command MMAIL/CVTTOPDF, leaves you the freedom to select a different conversion utility. Besides, when the PDF conversion utility CVTSPLSTMF is selected, it provides all the needed PDF formatting parameters.

A - Command MMAIL/EMLSPL allows to e-mail a message attaching up to 30 spool files. A conversion to PDF option is available at single spool file level. Optionally, a message body may be built from a text source member. The message can be e-mailed up to 50 receivers.

Command MMAIL/EMLSPL
                         E-mail spool files (EMLSPL)

 Type choices, press Enter.

 'Subject'  . . . . . . . . . . .   ____________________________________________
____________________________________
                                    ______________________________
 'Sender's name'  . . . . . . . .   ______________________________
 'Sender's e-mail address'  . . .   ______________________________
 Recipients . . . . . . . . . . .   ____          *TO, *CC, *BCC
   'name' . . . . . . . . . . . .     _____________________________________
   'e-mail address' . . . . . . .     _____________________________________
                + for more values   ____
 Spooled file . . . . . . . . . .   __________    Name
   Job name . . . . . . . . . . .     *CURRENT__  Name, *CURRENT
     job user . . . . . . . . . .     __________  Name
     job number . . . . . . . . .     ______      000000-999999
   Spooled file number  . . . . .     *LAST       1-9999, *ONLY, *LAST
   Convert spool file to PDF  . .     *NO_        *NO, *YES
                + for more values   __________
 Source mbr for message body  . .   *NONE_____    Name, *DFT, *NONE
   source file  . . . . . . . . .     __________  Name
   library  . . . . . . . . . . .     *LIBL_____  Name, *LIBL, *CURLIB
 Edit message body src mbr  . . .   *NO_          *NO, *YES
 Importance . . . . . . . . . . .   *MED        *LOW, *MED, *HIG
 Priority . . . . . . . . . . . .   *NRM        *NUR, *NRM, *URG
 Sensitivity  . . . . . . . . . .   *NRM        *NRM, *PRS, *PRV, *CNF
 'Reply-to e-mail address'  . . .   *FROMADDR______________________________
 Return receipt . . . . . . . . .   *NO_        *NO, *YES
 Save directory . . . . . . . . .   '/mmail/history'________________________
 PDF save directory . . . . . . .   '/mmail/temp'___________________________
 PDF name . . . . . . . . . . . .   'sample.pdf'____________________________
 Preformatted message body  . . .   N           N, Y

Subject: Subject of the message
Sender's name: Name of the person sending the message
Sender's address: E-mail address of the person sending the message
Recipients: up to 50 recipients can be specified; for each recipient the following must be given:
  • destination type: *TO, *CC, or *BCC
  • recipient name, within quotes
  • e-mail address, within quotes
Spooled file: up to 30 attachments can be specified; for each attachment the following must be given:
  • spool file name
  • qualified job name
  • spool file number
  • whether the spool file should be converted to PDF before being attached to the message.
    Information about conversion of spool files to PDF's is provided later in this page.
    The spool_file_to_PDF conversion program used in this process is the utility selected through command MMAIL/CVTTOPDF.
    Note 1- For additional parameters of command CVTSPLSTMF when spool file conversion to PDF is requested, see Note on CVTSPLSTMF spool file conversion to PDF.
    Note 2- If the conversion utility specified by command CVTTOPDF is CVTSPLSTMF (which handles only SCS spool files) and the spool file type is AFP, then utility CVTSPLFPDF (which handles both SCS and AFP spool files) is used instead.
    Note 3- If the conversion utility specified by command CVTTOPDF is the AFP TO PDF TRANSFORM FEATURE, then utility CVTSPLFPDF is used instead, because the transform feature cannot be used on existing spool files.
Source mbr for message body: member, file, and library name for the text to become the body of the message.
If *NONE specified, the message will have no body, just the attachment will be there.
If '*DFT' specified, library name and text source member name need not be specified: a QTEMP source file is generated and a default member name is assigned. *DFT is not supported in batch execution.
Edit message body src mbr: whether the source member for the message body should be edited (interactive job only). Editing is performed via STRSEU (if available), otherwise via EDTF.
Importance: *LOW=low, *MED=medium, *HIG=high
Priority: *NUR=non-urgent, *NRM=normal, *URG=urgent
Sensitivity: *NRM=normal, *PRS=personal, *PRV=private, *CNF=confidential
(use command mmail/setconfid to set the confidentiality statement).
Reply-to e-mail address: E-mail address of the person to receive reply messages, if different from the sender
Return receipt: whether a receipt should be returned to the sender when the recipient opens the message.
Save directory: IFS directory to contain a copy of the e-mailed MIME file, or *NONE .
PDF save directory: The PDF is deleted after been attached to the MIME file. However, you may specify an IFS directory where it should be saved before been deleted.
PDF name:
  • if you leave the default value *AUTO, all the PDF's are assigned a single computed name
  • you may specify a single pdf name of your choice ending with the extension .pdf .
In both cases, the final name of an attached PDF is the assigned name, preceeded by a sequence number. Preformatted message body: Whether the message body should be presented as preformatted text. A preformatted text is a text where all characters (including spaces) have the same width. Examples are texts including text tables (not html tables, of course).

Note 1. This command can run both in the interactive and in the batch environment.
Note 2- Fetching sender's name and e-mail from the system distribution directory
See Note 3 for command EMLMSG.

Example:

MMAIL/EMLSPL SUBJECT('Daily sales report')
FROMNAME('John Evans') FROMADDR('jevans@mail.com')
TO('dooley@superstar.com'/'Tom Dooley'/*TO)
SPLF(*YES/*LAST/*N/*N/*CURRENT/QSYSPRT)


B - Command MMAIL/EMLSPL2 is similar to command MMAIL/EMLSPL, except that each attachment can be assigned its own name.

Command MMAIL/EMLSPL2
                         E-mail spool files (EMLSPL2)

 Type choices, press Enter.

 'Subject'  . . . . . . . . . . .   ____________________________________________
____________________________________
                                    ______________________________
 'Sender's name'  . . . . . . . .   ______________________________
 'Sender's e-mail address'  . . .   ______________________________
 Recipients . . . . . . . . . . .   ____          *TO, *CC, *BCC
   'name' . . . . . . . . . . . .     _____________________________________
   'e-mail address' . . . . . . .     _____________________________________
                + for more values   ____
 Spooled file . . . . . . . . . .   __________    Name
   Job name . . . . . . . . . . .     *CURRENT__  Name, *CURRENT
     job user . . . . . . . . . .     __________  Name
     job number . . . . . . . . .     ______      000000-999999
   Spooled file number  . . . . .     *LAST       1-9999, *ONLY, *LAST
   Attachment name  . . . . . . .     *AUTO________________________________          
______________________________________
   Convert spool file to PDF  . .     *NO_        *NO, *YES
   PDF save directory . . . . . .     *NONE________________________________          
______________________________________
                + for more values   __________
 Source mbr for message body  . .   *NONE_____    Name, *DFT, *NONE
   source file  . . . . . . . . .     __________  Name
   library  . . . . . . . . . . .     *LIBL_____  Name, *LIBL, *CURLIB
 Edit message body src mbr  . . .   *NO_          *NO, *YES
 Importance . . . . . . . . . . .   *MED        *LOW, *MED, *HIG
 Priority . . . . . . . . . . . .   *NRM        *NUR, *NRM, *URG
 Sensitivity  . . . . . . . . . .   *NRM        *NRM, *PRS, *PRV, *CNF
 'Reply-to e-mail address'  . . .   *FROMADDR______________________________
 Return receipt . . . . . . . . .   *NO_        *NO, *YES
 Save directory . . . . . . . . .   '/mmail/history'________________________
 Preformatted message body  . . .   N           N, Y



C - Command MMAIL/EMLSPLX allows to e-mail a message attaching up to 50 spool files and can be e-mailed up to 50 receivers. Optionally, a message body may be built from a text source member.
It includes the same parameters as command EMLSPL. However:

  • An overall conversion to PDF option is available.
  • A parameter (PDFUTILITY) is available for selecting among the available conversion utilities.
  • If PDFUTILITY(*CVTTOPDF) and the conversion utility specified by command CVTTOPDF is the AFP TO PDF TRANSFORM FEATURE, then utility CVTSPLFPDF is used instead, because the transform feature cannot be used on existing spool files.
  • If PDFUTILITY(*CVTSPLSTMF), parameters for assessing the PDF layout are also prompted.

Example:

MMAIL/EMLSPLX SUBJECT('Daily sales report')
FROMNAME('John Evans') FROMADDR('jevans@mail.com')
TO('dooley@superstar.com'/'Tom Dooley'/*TO)
SPLF(*LAST/*N/*N/*CURRENT/QSYSPRT)
CVTPDF(*YES) MSGM(*DFT)
PDFUTILITY(*CVTSPLSTMF)
PAGESIZE(*CUSTOM) CUSTOMPAGE(200 300) FONT(*COURIER 8)





  4. E-mail save files

Command MMAIL/EMLSAVF allows to e-mail a message attaching up to 30 save files. Optionally, a message body may be built from a text source member. The message can be e-mailed up to 50 receivers.

Command MMAIL/EMLSAVF
                           E-mail save files (EMLSAVF)

 Type choices, press Enter.

 'Subject'  . . . . . . . . . . .   ____________________________________________
____________________________________
                                    ______________________________
 'Sender's name'  . . . . . . . .   ______________________________
 'Sender's e-mail address'  . . .   ______________________________
 Recipients . . . . . . . . . . .   ____          *TO, *CC, *BCC
   'name' . . . . . . . . . . . .     _____________________________________
   'e-mail address' . . . . . . .     _____________________________________
                + for more values   ____
 Save file  . . . . . . . . . . .   __________    Name
   Library  . . . . . . . . . . .     *LIBL_____  Name, *LIBL, *CURLIB
                + for more values   __________
 Source mbr for message body  . .   *NONE_____    Name, *DFT, *NONE
   source file  . . . . . . . . .     __________  Name
   library  . . . . . . . . . . .     *LIBL_____  Name, *LIBL, *CURLIB
 Edit message body src mbr  . . .   *NO_          *NO, *YES
 Importance . . . . . . . . . . .   *MED        *LOW, *MED, *HIG
 Priority . . . . . . . . . . . .   *NRM        *NUR, *NRM, *URG
 Sensitivity  . . . . . . . . . .   *NRM        *NRM, *PRS, *PRV, *CNF
 'Reply-to e-mail address'  . . .   *FROMADDR______________________________
 Return receipt . . . . . . . . .   *NO_        *NO, *YES
 Save directory . . . . . . . . .   /mmail/history__________________________
 Preformatted message body  . . .   N           N, Y
Subject: Subject of the message
Sender's name: Name of the person sending the message
Sender's address: E-mail address of the person sending the message
Recipients: up to 50 recipients can be specified; for each recipient the following must be given:

  • destination type: *TO, *CC, or *BCC
  • recipient name, within quotes
  • e-mail address, within quotes
Save file: up to 30 attachments can be specified; for each attachment the following must be given:
  • save file name
  • library name
Source mbr for message body: member, file, and library name for the text to become the body of the message.
If *NONE specified, the message will have no body, just the attachment will be there.
If '*DFT' specified, library name and text source member name need not be specified: a QTEMP source file is generated and a default member name is assigned. *DFT is not supported in batch execution.
Edit message body src mbr: whether the source member for the message body should be edited (interactive job only). Editing is performed via STRSEU (if available), otherwise via EDTF.
Importance: *LOW=low, *MED=medium, *HIG=high
Priority: *NUR=non-urgent, *NRM=normal, *URG=urgent
Sensitivity: *NRM=normal, *PRS=personal, *PRV=private, *CNF=confidential
(use command mmail/setconfid to set the confidentiality statement).
Reply-to e-mail address: E-mail address of the person to receive reply messages, if different from the sender
Return receipt: whether a receipt should be returned to the sender when the recipient opens the message.
Save directory: IFS directory to contain a copy of the e-mailed MIME file, or *NONE .
Preformatted message body: Whether the message body should be presented as preformatted text. A preformatted text is a text where all characters (including spaces) have the same width. Examples are texts including text tables (not html tables, of course).

Note 1. This command can run both in the interactive and in the batch environment.
Note 2- Fetching sender's name and e-mail from the system distribution directory
See Note 3 for command EMLMSG.

Example:

MMAIL/EMLSAVF SUBJECT('Save file QGPL/MYLIB') FROMNAME('John Evans') FROMADDR('jevans@mail.com')
TO('dooley@superstar.com'/'Tom Dooley'/*TO)
FILE(QGPL/MMAIL)




  5a. E-mail stream files

There are two commands for e-mailing stream files: MMAIL/EMLSTMF and MMAIL/EMLSTMF2.
The only difference between them is that, while command EMLSTMF supports a maximum length of 50 characters for the sender's and for the recipients' e-mail addresses, this maximum length is 256 in command EMLSTMF2.
Due to such likeness, we document hereafter just the EMLSTMF command.

Command MMAIL/EMLSTMF allows to e-mail a message attaching up to 30 ASCII stream files. Optionally, a message body may be built from a text source member. The message can be e-mailed up to 50 receivers.

Command MMAIL/EMLSTMF
                           E-mail stream files (EMLSTMF)

 Type choices, press Enter.

 'Subject'  . . . . . . . . . . .   ____________________________________________
____________________________________
                                    ______________________________
 'Sender's name'  . . . . . . . .   ______________________________
 'Sender's e-mail address'  . . .   ______________________________
 Recipients . . . . . . . . . . .   ____          *TO, *CC, *BCC
   'name' . . . . . . . . . . . .     _____________________________________
   'e-mail address' . . . . . . .     _____________________________________
                + for more values   ____
'Stream file'  . . . . . . . . .    ________________________________________
                + for more values   ________________________________________
 Source mbr for message body  . .   *NONE_____    Name, *DFT, *NONE
   source file  . . . . . . . . .     __________  Name
   library  . . . . . . . . . . .     *LIBL_____  Name, *LIBL, *CURLIB
 Edit message body src mbr  . . .   *NO_          *NO, *YES
 Importance . . . . . . . . . . .   *MED        *LOW, *MED, *HIG
 Priority . . . . . . . . . . . .   *NRM        *NUR, *NRM, *URG
 Sensitivity  . . . . . . . . . .   *NRM        *NRM, *PRS, *PRV, *CNF
 'Reply-to e-mail address'  . . .   *FROMADDR______________________________
 Return receipt . . . . . . . . .   *NO_        *NO, *YES
 Save directory . . . . . . . . .   /mmail/history__________________________
Subject: Subject of the message
Sender's name: Name of the person sending the message
Sender's address: E-mail address of the person sending the message
Recipients: up to 50 recipients can be specified; for each recipient the following must be given:

  • destination type: *TO, *CC, or *BCC
  • recipient name, within quotes
  • e-mail address, within quotes
Stream file: up to 30 stream files can be attached to the message. All the stream files to be attached must be in ASCII characters (CCSID 819 or 1252).
Source mbr for message body: member, file, and library name for the text to become the body of the message.
If *NONE specified, the message will have no body, just the attachment will be there.
If '*DFT' specified, library name and text source member name need not be specified: a QTEMP source file is generated and a default member name is assigned. *DFT is not supported in batch execution.
Edit message body src mbr: whether the source member for the message body should be edited (interactive job only). Editing is performed via STRSEU (if available), otherwise via EDTF.
Importance: *LOW=low, *MED=medium, *HIG=high
Priority: *NUR=non-urgent, *NRM=normal, *URG=urgent
Sensitivity: *NRM=normal, *PRS=personal, *PRV=private, *CNF=confidential
(use command mmail/setconfid to set the confidentiality statement).
Reply-to e-mail address: E-mail address of the person to receive reply messages, if different from the sender
Return receipt: whether a receipt should be returned to the sender when the recipient opens the message.
Save directory: IFS directory to contain a copy of the e-mailed MIME file, or *NONE .

Note 1. This command can run both in the interactive and in the batch environment.
Note 2. When running interactive, if *NONE not specified, the text source member for the body is edited prior to sending the message.
Note 3- Fetching sender's name and e-mail from the system distribution directory
See Note 3 for command EMLMSG.

Example:

MMAIL/EMLSTMF SUBJECT('My IFS file') FROMNAME('John Evans') FROMADDR('jevans@mail.com')
TO('dooley@superstar.com'/'Tom Dooley'/*TO)
STMF('/mydir/myphoto.gif')




  5b. E-mail a HTML stream file

Command MMAIL/EMLHTML allows to e-mail a HTML stream file (a HTML page). The HTML page is embedded in the body of the MIME message, thus resulting in a high quality message. The message can be e-mailed up to 50 receivers.

Command MMAIL/EMLHTML
                           E-mail HTML stream file (EMLHTML)

 Type choices, press Enter.

 'Subject'  . . . . . . . . . . .   ____________________________________________
____________________________________
                                    ______________________________
 'Sender's name'  . . . . . . . .   ______________________________
 'Sender's e-mail address'  . . .   ______________________________
 Recipients . . . . . . . . . . .   ____          *TO, *CC, *BCC
   'name' . . . . . . . . . . . .     _____________________________________
   'e-mail address' . . . . . . .     _____________________________________
                + for more values   ____
 'HTML stream file' . . . . . . .   ____________________________________________
 Importance . . . . . . . . . . .   *MED        *LOW, *MED, *HIG
 Priority . . . . . . . . . . . .   *NRM        *NUR, *NRM, *URG
 Sensitivity  . . . . . . . . . .   *NRM        *NRM, *PRS, *PRV, *CNF
 'Reply-to e-mail address'  . . .   *FROMADDR______________________________
 Return receipt . . . . . . . . .   *NO_        *NO, *YES
 Save directory . . . . . . . . .   /mmail/history__________________________
Subject: Subject of the message
Sender's name: Name of the person sending the message
Sender's address: E-mail address of the person sending the message
Recipients: up to 50 recipients can be specified; for each recipient the following must be given:

  • destination type: *TO, *CC, or *BCC
  • recipient name, within quotes
  • e-mail address, within quotes
HTML stream file: HTML stream file to be embedded in the body of the message
Importance: *LOW=low, *MED=medium, *HIG=high
Priority: *NUR=non-urgent, *NRM=normal, *URG=urgent
Sensitivity: *NRM=normal, *PRS=personal, *PRV=private, *CNF=confidential
(use command mmail/setconfid to set the confidentiality statement).
Reply-to e-mail address: E-mail address of the person to receive reply messages, if different from the sender
Return receipt: whether a receipt should be returned to the sender when the recipient opens the message.
Save directory: IFS directory to contain a copy of the e-mailed MIME file, or *NONE .

Note 1. This command can run both in the interactive and in the batch environment.
Note 2- Fetching sender's name and e-mail from the system distribution directory
See Note 3 for command EMLMSG.

Example:

MMAIL/EMLHTML SUBJECT('My HTML page') FROMNAME('John Evans') FROMADDR('jevans@mail.com')
TO('dooley@superstar.com'/'Tom Dooley'/*TO)
STMF('/mydir/mypage.html')




  6. Send a MIME file

Command SENDMIME allows to mail -through a single MIME message- a combination of different types of objects:

  • IFS stream files
  • Database files
  • Source file members
  • Spool files
  • Spool files converted to PDF
Up to 100 different pieces (objects) can be sent for each type of object.

Command MMAIL/SENDMIME
                           Send a MIME file (SENDMIME)

 Type choices, press Enter.

 Subject  . . . . . . . . . . . .   _______________________________________
 From:
   Sender Name  . . . . . . . . .   _______________________________________
   Sender Address . . . . . . . .   _______________________________________
 To:                                                                            
   Send TO, CC or BCC . . . . . .   ____   *TO, *CC, *BCC
   Receiver Name  . . . . . . . .   _______________________________________
   Receiver Address . . . . . . .   _______________________________________
                + for more values   _
 IFS file to attach:                                              
   Send as Text or Binary . . . .   *TEXT       *BIN, *TEXT
   Content Type . . . . . . . . .   *ATTACHED_   *ATTACHED, *BODY
   Mime type  . . . . . . . . . .   _______________________________________
   IFS File Name  . . . . . . . .   _______________________________________
   Character Set  . . . . . . . .   *SAME__________________________________
   New Extension  . . . . . . . .   ___          Character value
   Content ID . . . . . . . . . .   _____        0-999          
                + for more values   _
 Database file to attach:                                         
   Content Type . . . . . . . . .   *ATTACHED_   *ATTACHED, *BODY
   File Name  . . . . . . . . . .   __________   Character value 
   File Library . . . . . . . . .   __________   Character value 
   File Member  . . . . . . . . .   __________   Character value
   Content ID . . . . . . . . . .   ____         0-999
                + for more values   _
 Source file to attach:                                           
   Content Type . . . . . . . . .   *ATTACHED_   *ATTACHED, *BODY
   Source File Name . . . . . . .   __________   Character value 
   Source Library . . . . . . . .   __________   Character value 
   Source Member  . . . . . . . .   __________   Character value 
   Character Set  . . . . . . . .  *SAME__________________________________
   Content ID . . . . . . . . . .   _____        0-999          
                + for more values   _
 Spool file to attach:                                            
   Content Type . . . . . . . . .   *ATTACHED_   *ATTACHED, *BODY
   Spool File Name  . . . . . . .   __________   Character value 
   Spool Number . . . . . . . . .   ______       Character value 
   Spool Job Name . . . . . . . .   __________   Character value 
   Spool Job User . . . . . . . .   __________   Character value
   Spool Job Number . . . . . . .   ______       Character value
   Content ID . . . . . . . . . .   _____        0-999          
                + for more values   _
 Convert spool to PDF:                                           
   Spool File Name  . . . . . . .   __________   Character value
   Spool Number . . . . . . . . .   ______       Character value
   Spool Job Name . . . . . . . .   __________   Character value
   Spool Job User . . . . . . . .   __________   Character value
   Spool Job Number . . . . . . .   ______       Character value
   Content ID . . . . . . . . . .   _____        0-999
   PDF Name . . . . . . . . . . .   _______________________________________
   Save Directory . . . . . . . .   _______________________________________
                + for more values   _
 Importance . . . . . . . . . . .   MEDIUM____   LOW, MEDIUM, HIGH
 Priority . . . . . . . . . . . .   NORMAL____   NONURGENT, NORMAL, URGENT
 Disposition notify to:                  
   Notify Name  . . . . . . . . .   *NONE__________________________________
   Notify Address . . . . . . . .   *NONE__________________________________
 Reply to:                                  
   Reply to Email . . . . . . . .   *NOREPLY_______________________________
 Invalid Emails . . . . . . . . .   SEND__       SEND, REMOVE
 Work Directory . . . . . . . . .   _______________________________________
 Save Directory . . . . . . . . .   *NOSAVE________________________________




  7. Automated e-mailing of spool files

Suppose that your iSeries produces regularly some reports that you need to distribute to some people in your organization. Why not to have an utility that automatically sends such reports to them by e-mail, as soon as they become available?

MMAIL has an utility for that. This is how you use it.

  1. Use command MMAIL/WRKADDR to define the e-mail addresses of your users
  2. Use command MMAIL/WRKGRP to define Groups of addresses (distribution lists)
  3. The pivot of spool files distribution is a data queue. You may create a data queue and associate it to one or more output queues. Every time a spool file is made ready in one of these output queues, an entry is generated in the output queue. Our utility receives the data queue entries and (selectively) e-mail the spool files to their destinations.
    • To create an data queue,
          crtdtaq libxxx/dtaqyyy maxlen(500) aut(*change)
    • To associate a data queue to an output queue,
          chgoutq libaaa/outqbbb dtaq(libxxx/dtaqyyy)
  4. Command MMAIL/STREMLSPLF DTAQ(libxxx/dtaqyyy)
    (see later) starts e-mailing spool files
  5. Command MMAIL/ENDEMLSPLF DTAQ(libxxx/dtaqyyy)
    ends e-mailing spool files

Command MMAIL/STREMLSPLF
                   Start E-Mailing Spool Files (STREMLSPLF)

Type choices, press Enter.

'Sender's name'  . . . . . . . . FROMNAME      ______________________________
'Sender's e-mail address'  . . . FROMADDR      ______________________________
Data queue . . . . . . . . . . . DTAQ                      Name
  Library  . . . . . . . . . . .              *LIBL        Name, *LIBL, *CURLIB
Convert all spool files to PDF . CVTPDF     *YES          *NO, *YES
Remove e-mailed spool files  . . RMVSPLF    *YES          *YES, *NO
MIME message disposition . . . . DISP       *ATTACH       *IMBED, *ATTACH
Importance . . . . . . . . . . . IMPORTNC   *MED          *LOW, *MED, *HIG
Priority . . . . . . . . . . . . PRIORITY   *NRM          *NUR, *NRM, *URG
Sensitivity  . . . . . . . . . . SENSITIV   *NRM          *NRM, *PRS, *PRV, *CNF
Spool files and groups:          SPLFSND     
                                                          Name, generic*
                                                                 
                          + for more values  
Select from User Data  . . . . . CHKUSRDTA  *NO           *NO, *YES
Subject type   . . . . . . . . . SBJTYPE    A             A, B, C
PDF conversion option  . . . . . PDFCVTOPT  *             1-4, *
Distribution type  . . . . . . . DSTTYPE    *BCC          (0-2), *TO, *CC, *BCC
FROMNAME: Name of the person sending these messages
FROMADDR: E-mail address of the person sending these messages
DTAQ: name and library of the data queue associated to one or more output queues
CVTPDF: type *YES if you want all the spool files be converted to PDFs prior to be e-mailed.

RMVSPLF: enter *YES to delete a spool file once it has been e-mailed, enter *NO to retain it
DISP: enter *IMBED to embed the spool file in the mail message body, or enter *ATTACH to attach the spool file to the mail message
IMPORTNC: *LOW=low, *MED=medium, *HIG=high
PRIORITY: *NUR=non-urgent, *NRM=normal, *URG=urgent
SENSITIV: *NRM=normal, *PRS=personal, *PRV=private, *CNF=confidential (use command mmail/setconfid to set the confidentiality statement).
SPLFSND: this is a list of up to 50 entries. Each entry is made of two elements, spool file name and group name:
  1. spool file name: a string for selecting spool file names eligible for being e-mailed. It may contain a full file name (e.g. QSYSPRT), a generic name (e.g. QSYS*, or *ALL (all spool files will be e-mailed).
  2. group name: name of the address group to which the selected spool files should be e-mailed
CHKUSRDTA. In some cases, the user of this command would rather select the spool file to be e-mailed from the contents of the spool file user data rather than from the spool file name. This can be done by specifying *YES in this last parameter. In such a case, spool file user data (instead of spool file names) are checked vs the selection strings of the previous parameter.
SBJTYPE. This parameter establishes the way the subject of the e-mail is captured from the spool file.
  1. If type A (default value) specified, the subject is taken from the first line of the first page of the spool file. If this line is empty, then type B subject is used.
  2. If type B, the subject is made up from date and time, the system name, the qualified output queue name and the spool file name.
  3. If type C, the subject is searched in records of file MMAILDATA/EMLSPLFSBJ. If no match found, type A is used.
    Populating this file is up to the installer (a DFU or cgi_wrkdbf can be used).
    The record format of this file has the folllowing layout:
    1.char 10Output queue library
    2.char 10Output queue name
    3.char 10Spool file name
    4.char 10Spool file user data
    5.char 70Subject to be used
    Fields 1 to 4 are the search keys.
    Field number 4 may contain a specific user data value or *ANY as a wild card.
PDFCVTOPT. This parameter can be specified only if CVTTOPDF(*YES).
It is used to override the name of the spool-file-to-PDF conversion tool selected from command CVTTOPDF.
Allowed values:
  • * - use the PDF conversion tool specified in command CVTTOPDF
  • 1 - use the CVTSPLSTMF freeware
  • 2 - use the CVTSPLFPDF freeware
  • 3 - use the AFPTOOL product
  • 4 - use the INFOPRINT product
The AFP TO PDF TRANSFORM FEATURE cannot be used with command STREMLSPLF as it does not generate spool files.

DSTTYPE. This parameter establishes the type of addressee distribution.
Allowed values:
  • 0 or *TO: all addressees are in to: distribution
  • 1 or *CC: all addressees are in cc: distribution
  • 2 or *BCC: all addressees are in bc: distribution

Note 1. Command MMAIL/STREMLSPLF submits a batch job.
Note 2. Only one MMAIL/STREMLSPLF command can be issued for a given data queue. If the job submitted for a given data queue is still active, no more MMAIL/STREMLSPLF commands for the same data queue are accepted. Use command MMAIL/ENDEMLSPLF DTAQ(...) to end the submitted job.
Note 3.The following log files are maintained in library MMAILDATA:

  1. EMLSPLFLOG - A record for each spool file processed. Record layout:
    • timestamp
    • qualified name of the data queue
    • qualified name of the batch job processing spool files
    • qualified name of the job that produced the spool file
    • spool file name
    • spool file number
    • action performed by the program in charge for processing spool files
    This file contains records for the last 7 days. Old records are removed when command STREMLSTMF is entered.
  2. SPLLOG - A record for each mail destination of messages sent. Record layout:
    • date
    • time
    • data queue library name
    • data queue name
    • output queue library name
    • output queue name
    • spool file name
    • sent flag: Y=successful, N=failed
    • address group (distribution list)
    • addressee name
    • addressee e-mail address
    This file should be cleared now and then.



  7a. Automated e-mailing of spool files, Version 2

Command MMAIL/STREMLSPL2
is a slightly different version of command MMAIL/STREMLSPL1. Here are the differences:

  1. Command STREMLSPLF2 allows to have a message body common to all the automated e-mail messages. This message body is a stream file to be specifed in parameter BODY.
  2. In command STREMLSPL2 the distribution type (*TO, *CC or *BCC) here is at the same level of "spool file and group" (see command parameter SPLFSND), while in command STREMLSPLF the distribution type is a single value for all spool files and groups.
It is worth to be noted that, at a given time, just one of these commands (STREMLSPLF and STREMLSPLF2) can be active on a given outq-dataq.
                   Start E-Mailing Spool Files (STREMLSPL2)

Type choices, press Enter.

'Sender's name'  . . . . . . . . FROMNAME                                 
'Sender's e-mail address'  . . . FROMADDR                                 
Common message body (stmf) . . . BODY       *NONE                         
Data queue . . . . . . . . . . . DTAQ                      Name
  Library  . . . . . . . . . . .              *LIBL        Name, *LIBL, *CURLIB
Convert all spool files to PDF . CVTPDF     *YES          *NO, *YES
Remove e-mailed spool files  . . RMVSPLF    *YES          *YES, *NO
MIME message disposition . . . . DISP       *ATTACH       *IMBED, *ATTACH
Importance . . . . . . . . . . . IMPORTNC   *MED          *LOW, *MED, *HIG
Priority . . . . . . . . . . . . PRIORITY   *NRM          *NUR, *NRM, *URG
Sensitivity  . . . . . . . . . . SENSITIV   *NRM          *NRM, *PRS, *PRV, *CNF
Spool files and groups:          SPLFSND     
                                                          Name, generic*
                                                                 
                                              *TO 
                          + for more values  
Select from User Data  . . . . . CHKUSRDTA  *NO           *NO, *YES
Subject type   . . . . . . . . . SBJTYPE    A             A, B, C
PDF conversion option  . . . . . PDFCVTOPT  *             1-4, *
Command MMAIL/ENDEMLSPLF should be used to end the batch job submitted by command MMAIL/STREMLSPL2.


  8. Automated e-mailing of PDFs

This utility works as follow:

  • You create some IFS directories
  • For each directory you define a distribution list
  • As soon as a PDF is created in one of such IFS directories, it is e-mailed to the appropriate distribution list.
  • The tool you create a PDF with is irrelevant: it could be your favorite spool file conversion tool, Acrobat Distiller, the OS V6 AFP Transform Feature, ..., it does not matter as long as the stream file extension is PDF.

This is how you perform the set up:

  1. You must have an Audit Journal active on your system.
    To implement it:
    1. Logon to a green terminal with a user profile with special authority *AUDIT
    2. Enter the following commands
      CRTJRNRCV JRNRCV(QSYS/QAUDJRNRCV) AUT(*ALL)
      CRTJRN JRN(QSYS/QAUDJRN) JRNRCV(QSYS/QAUDJRNRCV) AUT(*ALL)
      CHGSYSVAL SYSVAL(QAUDCTL) VALUE(*AUDLVL)
      CHGSYSVAL SYSVAL(QAUDLVL) VALUE('*CREATE *DELETE *OBJMGT')
  2. Use command MMAIL/WRKADDR to define the e-mail addresses of your users
  3. Use command MMAIL/WRKGRP to define Groups of addresses (distribution lists)
  4. Create the IFS directories intended to contain PDFs to be e-mailed.
  5. Use command MMAIL/WRKEMLPDF to associate a directory to one or more distribution lists.

To start the PDF distribution "Automat", enter command MMAIL/STRMONIFS.

  • This command submits job STRMONIFS to subsystem QSYSWRK
  • The batch job
    • sets a trigger on physical file MMAILDATA/MONIFS
    • receives journal entries from the audit journal and creates records in file MMAILDATA/MONIFS
  • The trigger program receives control every time a new IFS object is created, checks the stream file directory and the stream file extension.
    If both appropriate, it e-mails the stream file to the due distribution list(s), then deletes the stream file.

To end the PDF distribution "Automat", enter command MMAIL/ENDMONIFS.

As a summary, when the setup is done, you just need to enter command MMAIL/STRMONIFS .

Note 1. The mail message is constructed as follow:

  • The subject is the PDF stream file name
  • The body is empty
  • The PDF is the only attachment.
The consequence of an empty body is the SPAM level of the message being raised by some points. In order to avoid this from happening, it is advisable to have the message body containing some header and/or footer. This can be done through commands MMAIL/EMLDFTBODY.

Note 2. Two logs are maintained from STRMONIFS:

  • Physical file MMAILDATA/PDFLOG. It contains a record for each addressee of a PDF-message e-mailed via STRMONIFS.
  • Physical file MMAILDATA/EMLPDFLOG. It contains a record for each PDF-message e-mailed via STRMONIFS.





  9. Default message body for EML... commands

The following commands:

  • EMLSAVF
  • EMLSTMF
  • EMLSPL
  • EMLSPL2
  • STREMLSLF
  • STREMLSPL2
may be used to e-mail messages with an empty text followed by one or more attachments.
Messages with an empty text are subject to raise their SPAM levels and therefore undergo the risk of being routed to the garbage or to the spam folder instead of being routed to the incoming mail basket.
This is why some default text must alway be added by these commands, whenever the user does not provide any text.
Use command MMAIL/EMLDFTBODY to specify such a default text. This command lets you
  • create the IFS stream file containing the default text
  • enter the default text
  • display it.



  10. Resend failed MIME messages

If for any reason a MIME file fails to be sent, it remains in directory /mmail/temp and cannot be re-sent unless you are able to call the QTMMSENDMAIL API passing all the requested parameters.

Command MMAIL/RESEND provides a way to invoke the QTMMSENDMAIL API for resending failed messages. Of course, in the problem is with the Mail Server Framework (MSF) or with the Simple Mail Transfer Protocol (SMTP), the resend of messages may very well fail also.

Command MMAIL/RESEND
                   Re-send failed messages (RESEND)

Type choices, press Enter.

Stream file  . . . . . . . . . .   *ALL                                              

Enter path and name of a MIME stream file to be resent.
If you specify *ALL, all MIME stream files in directory "/mmail/temp" are resent.




  11. Converting spool files to PDF

A number of tools are available for converting spool files to PDF:

  1. FREEWARES
    Two freewares are bundled in MMAIL:
    1. Command mmail/cvtsplstmf
      allows to convert an SCS spool file to a stream file, type text, html, or pdf.
    2. Command mmail/cvtsplfpdf
      allows to convert both an SCS and an AFP spool file to a stream file, type pdf.
      This command is available only from OS/400 release V5R1 on.
      This freeware is made of two libraries: TIFFLIB and HPT which are delivered with MMAIL and installed during MMAIL installation process. These libraries can also be downloaded from UZAEMON's Homepage.
    The above utilities must be taken "ASIS": no enhancements, no fixes can be requested. Their sources, however, are made available.
  2. CHARGED PRODUCTS
    The following products are supported by MMAIL, but they are on charge and must be ordered:
    1. IBM INFOPRINT SERVER for iSERIES (5722-IP1).
      This is a professional product for printing on iSeries. Among several other features, it includes the ability to convert spool files to PDF under user specified controls. Minimum requirement is V5R1.
      For information about Infoprint Server, see this page.
    2. AFPTOOL from BVSTools
      supports PDF conversion of both SCS and AFP spool files.
  3. i5 OS AFP TO PDF TRANSFORM
    Starting with V6R1, i5 OS supports the automated transformation of AFP spool file data to PDF stream files. You do need to have LPO 5761-TS1 *BASE and option 1 installed in order to use this support, but they are included on the CDs that come with the OS. For further information, please check out this page.
    In order to transform spool file data to PDF, you simply need to issue an override printer file before opening the printer file:
    OVRPRTF FILE(spool_file_name) DEVTYPE(*AFPDS) TOSTMF('pdf_path_and_name') WSCST(*PDF)
    The PDF stream file must not yet exist!!!
    The spool file is not generated!!!
    Please check out instructions following Figure 41.

Note 1
In the service program mmail/sendmail, subprocedure MimeSplPdf selects one of these ways to convert a spool file to PDF. You must use command mmail/cvttopdf to let this procedure know which of the four PDF conversion utilities should be used:

Figure 41- Command CVTTOPDF
Instructions for an appropriate use of the i5 OS AFP TO PDF TRANSFORM within MMAIL:
  • Run command MMAIL/CVTTOPDF (see Figure 41) and select option 5
  • Before creating a spool file, run command
    OVRPRTF FILE(spool_file_name) DEVTYPE(*AFPDS) TOSTMF('/mmail/pdf/spool_file_name') WSCST(*PDF)
    Please note that the PDF stream file MUST have the same name as the spool file and MUST be in directory /mmail/pdf .
    Subprocedure MimeSplPdf (invoked from command EMLSPL) looks for such PDF, attachs it to the MIME file, then deletes it.


Note 2
Instead of the above conversion tools, you may decide to use your favorite "spool to pdf converter". To do so, you must
  1. update program mmail/cvttopdf
  2. rework subprocedure MimeSplPdf in mmail/qrpglesrc member xxxmime
  3. recreate the service program and all programs through command mmail/compile

  1. mmail/cvtsplstmf
    This command allows to convert an SCS spool file to a stream file. The stream file type can be
    • text
    • html
    • pdf
    MMAIL/CVTSPLSTMF
             Copy Spool File to Stream File (CVTSPLSTMF)
    
    Type choices, press Enter.
    
    From spooled file name . . . . .   __________    Name
    To stream file name  . . . . . .   _____________________________________________
    To directory . . . . . . . . . .   _____________________________________________
    Job name . . . . . . . . . . . .   *_________    Name, *
      User . . . . . . . . . . . . .   __________    Name
      Number . . . . . . . . . . . .   ______        000000-999999
    Spooled file number  . . . . . .   ______        1-9999, *ONLY, *LAST
    Stream file format . . . . . . .   *TEXT_        *TEXT, *HTML, *PDF
    Stream file option . . . . . . .   *NONE___      *NONE, *ADD, *REPLACE
    
    Additional parameters for stream file format *TEXT:
    Stream file code page  . . . . .   *PCASCII_     1-32767, *PCASCII, *STMF      
    Additional parameters for stream file format *HTML:
    Title for HTML or PDF  . . . . .   *NONE_______________________________________
    Stream file code page  . . . . .   *PCASCII_     1-32767, *PCASCII, *STMF      
    Additional parameters for stream file format *PDF:
    Title for HTML or PDF  . . . . .   *NONE_______________________________________
    Page size:                                                                  
      Paper size . . . . . . . . . .   *SPLF__       *SPLF, *CUSTOM, *A4, *A5...
      Orientation  . . . . . . . . .   __________    *LANDSCAPE, *PORTRAIT
    Font:                                                                      
      Face . . . . . . . . . . . . .   *CONVERT_     *CONVERT, *COURIER...
      Size . . . . . . . . . . . . .   _____         4-36, *CALC
    Type of PDF bookmarks  . . . . .   *PAGNBR_      *PAGNBR, *POS, *KEY, *NONE
    Stream file code page  . . . . .   *PCASCII_     1-32767, *PCASCII, *STMF      

    Note on CVTSPLSTMF spool file conversion to PDF
      Command CvtSplStmf is implicitly executed when one of the following commands asks for spool file conversion to PDF:
    • EMLSPL
    • STREMLSPL
    • SENDMIME
    • SPLFTOPDF
    or when one of the following subprocedures is executed
    • MimeSplPdf
    • SplPdf
    and option 1 (CvtSplStmf) was specified in command CvtToPdf.
    The above commands, however, do not allow to specify any of the PDF conversion parameters available in command CVTSPLSTMF.
    The way to overcome this, is to issue command MMAIL/SETSPLSTMF before using one of the above commands.
    Command MMAIL/SETSPLSTMF allows to specify the CVTSPLSTMF PDF conversion parameters. These parameters are made available to all the subsequent CVTSPLSTMF commands issued in that same job.


  2. mmail/cvtsplfpdf
    This command allows to convert a spool file to a PDF stream file. The spool file can be SCS or AFP.
    Spool files must not be greater than 16 Mb.
    MMAIL/CVTSPLFPDF
             Convert spool file to pdf (CVTSPLFPDF)
    
    Type choices, press Enter.
    Spooled file name  . . . . . . .                Name
    PDF path and name  . . . . . . .                                                
    Job name . . . . . . . . . . . .   *            Name, *
      User . . . . . . . . . . . . .                Name
      Number . . . . . . . . . . . .                 000000-999999
    Spooled file number  . . . . . .                 1-9999, *ONLY, *LAST
    Replace PDF stream file  . . . .   *YES          *YES, *NO
    
    Other parameters are available to specify paper size, orientation, and margin.
    Note 1
    This command is based on a free software (libraries HPT and TIFFLIB) originated from Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Anyone using this software must know that it is available at no charge. To know more about copyrights, please read members COPYING and LICENSE in HPT/LICENSE.
    Note 2
    The conversion process is performed in two steps:
    • conversion of the spool file to a .tif stream file (command hpt/spl2stmf
    • conversion of the .tif stream file to a .pdf stream file (command tifflib/tiff2pdf
    Note 3
    When running under OS/400 release V5R4 or subsequent, it is suggested to invoke command CVTSPLFPDF from a user profile specifying LOCALE(*NONE).

    Note on CVTSPLFPDF spool file conversion to PDF
      Command CvtSplfPdf is implicitly executed when one of the following commands asks for spool file conversion to PDF:
    • EMLSPL
    • STREMLSPL
    • SENDMIME
    • SPLFTOPDF
    or when one of the following subprocedures is executed
    • MimeSplPdf
    • SplPdf
    and option 2 (CvtSplfPdf) was specified in command CvtToPdf.
    The above commands, however, do not allow to specify any of the PDF conversion parameters available in command CVTSPLFSTMF.
    The way to overcome this, is to issue command MMAIL/SETSPLSTMF before using one of the above commands.
    Command MMAIL/SETSPLFPDF allows to specify the CVTSPLFPDF PDF conversion parameters. These parameters are made available to all the subsequent CVTSPLFPDF commands issued in that same job.


  3. afptool/afptool
    This command allows to convert a spool file to a PDF stream file. The spool file can be SCS or AFP.
    AFPTOOL/AFPTOOL
             Convert AFP to PDF (AFPTOOL)
    
    Type choices, press Enter.
    
    Spooled file name  . . . . . . .                Name
    Job name . . . . . . . . . . . .   *            Name, *
      User . . . . . . . . . . . . .                Name
      Number . . . . . . . . . . . .                 000000-999999
    Spooled file number  . . . . . .                 1-9999, *ONLY, *LAST
    Output stream file . . . . . . .                                                
                               Additional Parameters
    Replace object . . . . . . . . .   *NO           *YES, *NO
    Manufacturer type and model  . .   *WSCST        
    WSCST Name . . . . . . . . . . .   QWPTIFFG4     Character value, *NONE
    WSCST Library  . . . . . . . . .   QSYS          Character value, *LIBL
    Temp path  . . . . . . . . . . .   '/tmp'                                       
    Page rotation  . . . . . . . . .   0             0, 90, 180, 270
    Margin offset  . . . . . . . . .   20            Number
    Left margin offset . . . . . . .   0             Number
    Top margin offset  . . . . . . .   0             Number
    Note 1
    This command requires library QFNTCPL (AFP Compatibility Fonts, product 5722SS1, option 8, feature 5050).
    Note 2
    Both libraries AFPTOOL and QFNTPCL must be added to the job library list.

  4. IBM Infoprint Server for iSeries (5722-IP1)
    This product needs no commands. It would convert to PDF any spool file created or moved to a given output queue.
    To use this product within MMAIL:
    1. set up the environment needed by Infoprint Server by using command MMAIL/INFOPRINT
    2. use command MMAIL/CVTTOPDF to select it as the preferred conversion tool
    3. any time you ask the MMAIL/SENDMAIL service program to e-mail a spool file after converting it to PDF, the spool file will be moved to the INFOPRINT output queue, get converted to PDF, attached to your MIME message and e-mailed.
      For information about Infoprint Server, see this page.


  12. Logging messages

A requirement common to many companies is that of maintaining a complete log of all the e-mail messages sent out from MMAIL. Though some of the MMAIL e-mail commands in this page have some log facilities, the best way is that of providing a general log service from service program MMAIL/SENDMAIL, the piece of software in charge for sending any MMAIL-based message.

The solution implemented for such a general log facility is to have the service program sending a blank copy of each message to a given number (at least one) of e-mail addresses ("blind receivers"). These blind receivers could then act as log facilities, taking advantage of all the features provided by client e-mailers for sorting, searching, and displaying e-mail messages.

The architecture is very simple:

  1. A data area (MMAILDATA/MDTBC) is used to enable / disable the blank copy feature.
  2. A database file (MMAILDATA/MDTBC) is used to maintain the e-mail addresses of the blind receivers.
Command MMAIL/WRKMDTBCC (see the next figure) must be used to properly set the data area and to maintain the database file:
Command WRKMDTBC (Work with mandatory blank copies)


  13. Manage spool files

Some MMAIL users have raised the requirement to have a command similar to WRKSPLF, but also able to:

  • e-mail a selected spool file
  • convert a spool file to a stream file, either as a TEXT file (.TXT), or an HTML file (.HTML) or a PDF file (.PDF).
That has been implemented in January 2006 through command mmail/mngsplf (Manage spool files). This command (when prompted) allows more granular selection of spool files than the OS/400 WRKSPLF command, and fulfills the requested conversion types.
This command takes advantage of these other following commands:
  1. mmail/emlspl, to e-mail a spool file (after optionally converting it to a PDF)
  2. mmail/cvtsplstmf, to convert a spool file to a text or to an html stream file
  3. mmail/spltopdf, to convert a spool file to a pdf stream file, using the preferred conversion tool selected through command cvttopdf.
Figure 1 - Command MNGSPLF


  14. WEB utilities

In February 2006, some interesting utilities have been made available for the WEB user. They allow to control spool files and spool writers from a remote browser via HTTP. Functions like spool file e-mailing, conversion to stream file or to PDF are also supported.

In order to work, these utilities require some directives be added to the HTTP configuration (see later).

Two utilities are currently available:

  1. WRKSPLF (Work with spool files)
  2. WRKWTR (Work with printer writers)

10a. WRKSPLF

This utility is invoked through the URL
http://.../mmailp/wrksplf.pgm

It is very similar to the 5250 MNGSPLF utility, though more flexible.

An initial screen (see Figure 2) allows to specify selection criteria for the spool files:
Figure 2 - Starting WRKSPLF
Multiple selection criteria are handled in an "AND" condition.
Please note the ability to specify even the number of lines per page.

When *ALL output queues selected, the WEB page looks like that in Figure 3:
Figure 3 - Working with all spool files

On the other side, when in Figure 2 a given output queue is specified, the WEB page also carries controls for that output queue:
Figure 4 - Working with an output queue

About the spool file controls (buttons).

  • The Hold, Release, and Delete buttons can process multiple spool files (for instance, you may delete five spool files in a single shot).
  • The other buttons (Change (change spool file attributes), Display (display a spool file), Attributes (display spool file attributes), E-mail (e-mail a spool file), Cvt to Stmf (convert a spool file to a stream file), and Cvt to Pdf (convert a spool file to a PDF stream file)) process a single spool file at a time and provide separate prompts in a new window for each function.
About spool writers.
Button Work with all printers switches to the WRKWTR WEB utility (see next).

10b. WRKWTR

This utility is invoked through the URL
http://.../mmailp/wrkwtr.pgm
or it may get control from the WRKSPLF utility.

This utility is the WEB version of the WRKWTR 5250 command.
It provides the status of all writers in a single page (see Figure 6).

Figure 6 - Working with writers

About the writers controls (buttons).

  • The Hold, End, and Release buttons may operate on multiple writers (for instance, you may end several writers in one shot).
  • Other buttons (Start (start a writer), Change (change the properties of a writer), and Messages (work with unanswered writer messages)), process a writer at a time by providing control pages in separate windows. See the example of the Messages button in Figure 6.
    Figure 6 - Working with writer unanswered messages

    Switching to spool files control. There are two ways you may switch from the page in Figure 5 to the WRKSPLF utility.

    • By selecting a writer and pushing the button wrkoutq, you will go to a page like that in Figure 4.
    • By clicking button work with all spool files, you will go to the page in Figure 2.

    10c. HTTP directives

    When you install MMAIL, the installation procedure would suggest the installation of some HTTP directives for MMAIL. Such directives allow to display the WEB manual (THIS manual) and to run the WEB utilities.

    However, ih this is not your first MMAIL installation, and you already installed the MMAIL HTTP directives, you may not want to do that again.
    In such a case, you may want to check your MMAIL existing HTTP directives in your system, and the ones documented here, and add the missing ones. By doing do, you will enable the MMAIL WEB utilities for appropriate execution.

    The are two cases.

    1. If you are running an OS/400 release before V5R2, you must run the Original HTTP server (V5R1 Apache HTTP server is not recommended). In this case, please check the "MMAIL Original HTTP Directives". That may also be true if you are running OS/400 V5R2 still with the Original HTTP server.
    2. If you are running the Apache HTTP server (optional on V5R2, mandatory from V5R3 on), please check the "MMAIL Apache HTTP Directives".

    1 - MMAIL Original HTTP Directives
    #==== MMAIL, MIME & MAIL ==============================  
    Protection MMAILPR  {                                    
          ACLOverride Off                                    
          PostMask All                                       
          GetMask All                                        
          AuthType Basic                                     
          ServerID "MIME & MAIL"                             
          PasswdFile %%SYSTEM%%                              
          UserID %%CLIENT%%                                  
    }                                                        
    Protect /mmailp/* MMAILPR                                
    Map  /mmail/start   /mmail/html/intro.htm                
    Map  /mmailh/* /mmail/html/*                             
    Map  /mmailp/*.cgi  /mmailp/*.pgm                        
    Pass /mmail/*                                            
    Exec /mmailp/* /QSYS.LIB/MMAIL.LIB/*  %%EBCDIC%%
    To change / add directives
    • enter command WRKHTTPCFG CFG(xxx), where xxx is the name of the appropriate HTTP instance (usually "CONFIG" for HTTP instance DEFAULT)
    • restart that HTTP instance

    2 - MMAIL Apache HTTP Directives
    #----        MMAIL directives                
    AliasMatch /mmailh/(.*)  /mmail/html/$1                      
    AliasMatch ^/mmail/start$ /mmail/html/intro.htm
    Alias /mmail/    /mmail/                                     
    ScriptAliasMatch /mmailp/(.*).pgm /qsys.lib/mmail.lib/$1.pgm 
    ScriptAliasMatch /mmailp/(.*).cgi /qsys.lib/mmail.lib/$1.pgm 
    <Directory /mmail>                                           
       AllowOverride None                                        
       Options None                                              
       order allow,deny                                          
       allow from all                                            
    </Directory>                                                 
    <Directory /QSYS.LIB/MMAIL.LIB>                              
       Options +ExecCGI                                          
       CgiConvMode %%EBCDIC/EBCDIC%%                             
       AllowOverride None                                        
       Options None                                              
       order allow,deny                                          
       allow from all                                            
    </Directory>                                                 
    <LocationMatch /mmailp/(.*)>                                 
       AuthType Basic                                            
       AuthName "MIME & MAIL" 
       PasswdFile %%SYSTEM%% 
       UserID %%CLIENT%%     
       Require valid-user    
    </LocationMatch>
    To change / add directives
    • enter command STRPDM option 3 over file QUSRSYS/QATMHINSTC
    • display the member with the same name as the HTTP instance you want to update
    • there is a single record there; make up the name of the IFS stream file containing the configuration directives
    • use command EDTF on that stream file to perform HTTP directives maintenance
    • restart that HTTP instance


    Contact