How to Set Up Automated Report Distribution Using Esend

April 28, 2020
Esend Remote Report Distribution


Many organizations need to have their business users work remotely. But they have a problem with spooled file reports getting to the users. The good news is that you can easily solve this issue using our Esend solution.

Esend uses the IBM i SMTP and Mail Server Framework (MSF) to send spooled files via email. Within Sequel, Esend is used to send SQL results in a variety of PC formats. It works beautifully as a stand-alone solution, but you can also pair it with Sequel for data access and business intelligence or Abstract, our developer productivity tool.

In fact, if you’re already using one of these solutions, you may already be somewhat familiar with Esend. But be aware that you may only be using a small portion of Esend’s full potential! Such was the case for one government agency using Sequel and Esend.

They used the Esend Address Book feature to email spooled file reports within the company network and outside.

Their business users use Sequel and an IBM i package that generates spooled files. Normally, these spooled files would go to an out queue with a printer. However, with the users all working remotely due to unforeseen circumstances (think, the COVID-19 pandemic of 2020) no one was in the office or near the printer.

Our savvy Sequel user wondered if there was a way for Esend to automatically email the spooled files to the users.

Not only is it possible, but it’s relatively simple, too! Here’s how we solved the problem together.


Step 1: Redirect Spooled Files

On her IBM i, our Sequel user redirected the spooled file output to go to a single out queue. Esend has the ability to use all IBM i output queues. But this was the easiest and most effective way in this case.


Step 2: Set Rules

Next, we set out to make the rules in Esend. We told Esend that the output queue she just created was going to use Esend forwarding rules. All that was needed was to add the queue name to EFWDOUTQ, Esend main menu, option 15. After that, we set up the rule.

Forwarding rules in Esend are in two parts:

  1. What is the rule looking for?
    This can be for a specific user running a specific report or it can be wide open, any spooled file hitting the output queue. In this case, all spooled reports were to be sent.
  2. What should the rule do with the report?
    In this case, our Sequel user wanted the rule to deliver the report in PDF format to a specific user. So, we used the variable value &USRPRF to pick up the IBM i user profile running the job. This value was already set up in the Esend address book to coincide with the user’s actual email address.


Step 3: Hit Go

From there, all we had to do was to start the Esend forwarding subsystem using the Esend configuration menu option 11 or the command STRSBS EFWD. This should be in the system startup routine if forwarding is to be used regularly.

The result? Our Sequel user generated a spooled file report and automatically received an email with the PDF attached. Just like that! We checked back in with her not too long after and she was happy to report that her business users were loving the new process.

Check out this video to see how we set up automatic forwarding for remote users using the enhanced features in Esend:


Manual Email without Automatic Forwarding

Prior to automating the email process, our Sequel user had come across a screen in Esend where the users could manually email a spooled file that had been generated. Even though the WRKSPLFE screen (Esend main menu option 10) is a manual process, it still is a beneficial part of Esend.

Many of you may be familiar with the IBM i screen to manage your spooled files. It’s called WRKSPLF or Work with Spooled Files. In Esend, WRKSPLFE has the same options you have in the IBM i version, but with the Esend options added:







Esend Mail

Email multiple attachments



Esend File

Email / FTP single attachment



Copy to IFS

Copy spooled file to IFS



Email w/ Distribution Rule

Send email with distribution rule



Create PDF on IFS

Create PDF on IFS from spooled file



Copy Spooled File

Copy spooled file to database file



Change Out Queue

Work with/change the output queue



Work with Out Queue

Work with/change the output queue



Copy to Out Queue

Copy the spooled file to a different out queue



Work with Job

Work with the job



Copy to User

Copy the spooled file to a different user



Move to User

Move the spooled file to a different user

Business users who had generated a spooled file report could go to this screen to manage their spooled files. Some Sequel customers have their users use this screen instead of WRKSPLF to get Esend options. 

Once on the screen, place the desired option next to the spooled file. With many of the Esend options, you can press enter and see a quick screen to accomplish the task. You can press F4 (prompt) to be taken into the complete command for additional options.

For example, option E for ESNDMAIL next to a spooled file presents a shortened screen to email the file. Esend defaults are set the way you need them; all you enter is the recipient's email address. But you can change the attachment type, subject, and message.


Basic Esend Can Still Help

Some of our Sequel and Abstract users do not have access to the enhanced Esend features for forwarding or WRKSPLFE. However, they can still take advantage of many of the Esend commands directly:



Menu Option #


Email multiple attachments



FTP or email single attachment



Maintain FTP List



Copy spooled file to IFS



Create a PDF file from a spooled file


These commands can be called from a command line, placed on a menu, or CLP. The jobs can be scheduled as well, using the IBM i job scheduler or Robot Schedule from HelpSystems.

Enhanced Esend adds an easy-to-use level of automation to your spooled file distribution. The forwarding rules, address book, and WRKSPLFE screen we’ve seen here gives your remote users the PC files they need. Base Esend users can experiment with the enhanced features simply by requesting a temporary code.

Do More with Esend

From IBM i spooled files to email and FTP, automate your spooled data reports delivery with Esend. Contact us to get started.

Stay up to date on what matters.