How to attach spool file to mail and send to mail using SNDDST?

Tags:
AS/400
AS/400 Spool Files
SNDDST
Hi Friend,
Please help me, how to attach the spool file to mail and send the mail for the list of users using SNDDST command.
Please advise.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • pdraebel
    SNDDST allows you to send over files from iSeries, however you may need to perform some conversion on the file first. If your release level is high enough you can easily Copy Spoolfiles into formats readable on Windows machines. Else use a TYPE of *FILE and put the name in the DOCFILE parameter.
    7,545 pointsBadges:
    report
  • TheRealRaven
    (Assuming that you're not asking about sending a distribution in a SNA network...) First thing that should be done is to stop using SNDDST to send e-mail. Use SNDSMTPEMM if you're at i 6.1 or later. Even better, install an actual SMTP e-mail product; various good, free products are available. Or you can use the Send MIME Mail (QtmmSendMail) API to write your own e-mail program. Or use the JavaMail API if you prefer. Or go straight to sockets programming and code it however needed.

    Next, what do you mean by "spool file"? Unless you're sending to an *OUTQ on a remote system, you can't send a "spool file" anywhere. You can create a text file, or perhaps better, a .PDF, from a spooled file and send that through e-mail.

    If it must be done through SNDDST, good ways to do it depend on your OS version. At IBM i 6.1, you can use OVRPRTF WSCST(*PDF) to generate the spooled file as a .PDF. At i 7.2, you can use CPYSPLF WSCST(*PDF) to copy a spooled file to a .PDF. Either way, the .PDF might be copied into a folder so that SNDDST can attach and send it. It would need base64 encoding and appropriate MIME headers.

    If a .PDF isn't reasonable and the spooled file has only text characters (no images or graphics), then base64 encoding isn't needed. You just need to copy the spooled file text content into a folder. The CPYSPLF command can copy spool text into a flat physical file, and SNDDST can send it from the file.

    If you wish, CPYTOPCD can copy the flat file into a document in a folder; and SNDDST can send from there.

    Instead of CPYTOSPLF, the catsplf QShell utility can copy spooled file text data into a streamfile. I wouldn't run it to write to a folder document, but it should work. If it doesn't, you can still copy from a normal IFS streamfile into a /QDOC folder document.
    32,320 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: