How to email output from Background Jobs
One of my Customers has a regularly scheduled job with spool (SP01) output. They have asked if it could be be emailed to a group email address. The address management is nice and easy in this case; they manage the mail group, adding and deleting email addresses as people move in and out of the group. But how do we send the spool output as email ?
Go into transaction SM37 (Job Overview) and search for the job that creates the output you wish to mail. You need to make sure you find a scheduled, released or ready version of the job as you can’t do this with an existing spool output.
Select the job in question, then select Job –> Change from the menu (or CTRL+F11). This gives you the Change Job detail screen. Select the button labelled Spool list Recipient This will show the Recipeint Determination Dialog.
Put the target address into the Recipient field. Note that this doesn’t have to be an email address; you can use email, fax or X.400 messaging. Depending on which method you choose, you can add extra options by selecting the appropriate button at the bottom of this dialog. Select the tick when you’re done and you’ll be returned to the Change Job detail screen.
Don’t forget to save your changes on this screen as well.
There’s lots of errors possible with email. If the users don’t get the email, or there is a problem with it, checking that the output was written to the spool (use transaction SP01 or SM37).
If the email is truncated when compared to the spool output, check OSS Note329537 – Spool cut off at 1000 lines when sent to recipient.