Emailing EZ Print/400 or Optio Reports Automatically to Multiple Email Addresses from a User Process and WinSpool/400 Email Report Server - Support

Emailing EZ Print/400 or Optio Reports Automatically to Multiple Email Addresses from a User Process and WinSpool/400 Email Report Server

From Support

Jump to: navigation, search

These steps can be utilized to allow a user process to generate an electronic form with EZ Print/400 or Optio and allow the electronic form to be sent to multiple email addresses automatically by the RJS Email Report Server products. EZ Print/400 has a major limitation that doesn't allow the EZ Print/400 software to pass the "User Defined Data" through its process, but EZ Print does allow the 10 character "User Data" value to be passed through its processing. Our solution allows the "User Data" field of a report to be set with a mail key value that carries a pointer to associated email address information for the report. This process simulates embedding an email address within a report by using the mail key and associated email addressing information.

    • Note: These steps can also be used for text reports as well, however we recommend using embedded email addresses for non-EZ Print report files. These steps are geared towards EZ Print/400 and other non-text reports.

Updating WinSpool/400 Library In order to use the latest support, you must update to the latest version of the WinSpool/400 library V3.39 (WINSPOOL) or above. http://www.rjssoftware.com/files/winspool.exe

Steps for setting email addresses for EZ Print Reports 1.) In your CL program you would first call the WSPMAILKEY command to retrieve a unique 10 digit mail key value that can be placed into the spool file "User Data" field to uniquely identify a report and its associated email addresses. The mail key will have the following format: EML0000001

Example: WSPMAILKEY RTNKEY(&MAILKEY)

2.) Next, you would call the WSPADDRESS command to set up any destination email addresses for the report that's going to be sent out. Each call to the command can have up to 10 destination email addresses. You can also call the WSPADDRESS command multiple times for a single report if more than 10 email recipients are required for a single report. This is how you can send the one report to multiple email recipients.

Example: WSPADDRESS MAILKEY(&MAILKEY) TOADDRESS(sales@rjssoft.com support@rjssoft.com)

3.) Use the OVRPRTF command to set the mail key value into the "User Data" field for your new spool file.

Example: OVRPRTF FILE(QSYSPRT) USRDTA(&MAILKEY)

4.) Print your report into an output queue where EZ Print/400 will process it.

5.) When EZ Print/400 processes the report, have the EZ Print/400 software create the new report into a temporary holding output queue. Don't send it to the Email Report Server output queue yet. That will happen in the next step.

6.) All mailable EZ Print/400 files should now be sitting in the temporary holding output queue and each report should have a unique User Data value of EMLxxxxxxx set for the mail key. If you are not emailing a particular EZ Print/400 report file, set the user data to some value other than EMLxxxxxxx. The user data value can also be blank.

7.) Now that the EZ Print reports are ready to be emailed, you have two ways to process the completed EZ Print/400 files so they get emailed correctly.

a.) Use the WSPROUTE command to manually read all spool files in the holding output queue and move them to the Email Report Server processing output queue. This command can be embedded into your own processes or called manually via a menu. A copy of the report is automatically made for each recipient in the email output queue.

Example: WSPROUTE OUTQ(QGPL/EZPRINTHLD) DESTOUTQ(QGPL/EZEMAIL) SPLFOPT(*MOVE) MOVEOUTQ(QGPL/EZPRTSAVE)

The command listed above reads all reports in output queue EZPRINTHLD and sends any that have a mail key (EMLxxxxxxx) over to the EZEMAIL output queue where they will get emailed by the Email Report Server software. After selected reports have been sent to EZEMAIL, they will be moved to output queue EZPRTSAVE for backup purposes.

b.) Use the WSPROUTMON command to automatically read all spool files in the holding output queue and move them to the Email Report Server processing output queue. This command can be embedded into your own processes, called manually via a menu or submitted as an AS/400 batch job. The process will run continually until an end time is specified. If 000000 is entered for the end time, the process will run endlessly.

Example: WSPROUTMON DELAY(*ONCE) DLYTIM(300) ENDTIME(160000) OUTQ(QGPL/EZPRINTHLD) DESTOUTQ(QGPL/EZEMAIL) SPLFOPT(*MOVE) MOVEOUTQ(QGPL/EZPRTSAVE)

The command listed above reads all reports in output queue EZPRINTHLD and sends any that have a mail key (EMLxxxxxxx) over to the EZEMAIL output queue where they will get emailed by the Email Report Server software. After selected reports have been sent to EZEMAIL, they will be moved to output queue EZPRTSAVE for backup purposes. The process will run every 300 seconds (5 minutes) until 4:00pm.

The above steps will allow EZ Print/400 tp be staged for emailing and emailed automatically via the Email Report Server software.

Personal tools