Email Spoolfiles DirectoryDirectory .ZIP
These include a SPLF2EMAIL command and CL program that show the simplest, most basic technique for e-mailing AS/400 spoolfiles to an Internet e-mail address. The basis is the SNDDST command with the TOINTNET() parameter sending a physical file. Therefore, the direct requirements are TCP/IP and SMTP configured and running, a recent version of SNDDST from at least OS/400 V4R1 and a spoolfile that can be copied to a physical file with CPYSPLF (e.g., AFPDS is not supported).
Please read the @GENERAL DISCLAIMER document for any items you should be aware of if you download any of these items.
SPLF2EMAIL -- Spoolfile to E-mail:This program accepts a spoolfile name and number, a qualified job name, an Internet recipient e-mail address and an optional message and sends the specified spoolfile as an e-mail attachment to the recipient.
You should become familiar with the physical files that result from CPYSPLF before using this technique. In this program, CPYSPLF is run with the CTLCHAR(*FCFC) parameter value set. When the recipient is known to be an AS/400 user, the attachment created by this program can be turned back into an AS/400 spoolfile easily enough after it's loaded back into another physical file. After running CPYSPLF to get a spoolfile into a physical, test variations of the following command sequences with different record lengths, etc., to get a feel for the process:If the recipient is not an AS/400 user or you simply require more formatting control than is allowed here, consider whether you can create a program to do some pre-processing of the physical file before it gets passed to the CPYTOPCD command and converted into a document. You might want to run through the file and insert blank lines according to the values of the *FCFC characters or you might want to remove additional records that result from using field attributes such as bold or underline in the printer file definition. Experiment with variations so you'll know what to handle.OVRPRTF FILE(QSYSPRT) CTLCHAR(*FCFC) CPYF FROMFILE(mylib/myfile) TOFILE(QSYSPRT)
SPLF2EMAIL -- Spoolfile to E-mail:The command definition object source for SPLF2EMAIL. This encapsulates the SPLF2EMAIL CLP and defines the attributes of the JOB(), SPLFNAM(), SPLFNBR(), TOINTNET() and MSG() parameters. As supplied, the SPLF2EMAIL function is useful for most basic tasks. I use it primarily to send diagnostic spoolfiles to IBM support (although I had to explain to them how to use the attachment once it arrived).
If you are sending spoolfiles to external customers, you will want a more robust solution; numerous commercial variations exist. However, it is possible with limited effort to pre-process the physical data of the spoolfile to make a cleanly presentable result as long as you aren't getting fancy with graphics or fonts, etc.