ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Email SPool file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Email SPool file

    Hi,

    How to email the spool file ??????with out using additional object

    Thks
    Susan

  • #2
    Re: Email SPool file

    Do you mean send it from within a program when it is ready in OUTQ ?
    Philippe

    Comment


    • #3
      Re: Email SPool file

      Yes,

      from the program only

      Comment


      • #4
        Re: Email SPool file

        I "think" the user profile running the job has to be enrolled in WRKDIRE (directory entries) with a valid email address in order to be able to send the emails.

        Look at this snippet and see if you can use it ?
        We have a form where you can optionally type another email recipient to get a CC of the email, it is ignored if *NONE is used.

        Isn't CL a wonderful language !!!

        PHP Code:
            /* Prepare E-Mail Body .............................. */          
            
        CHGVAR     VAR(&TOFILVALUE(&MONTH *TCAT 'Rpt' *TCAT '.' *TCAT 'TXT'
            
        RTVNETA    SYSNAME(&SYS)                                      
            
        CHGVAR     VAR(&MSGVALUE('Please find attached +     
                         the Job Total Reports From:' 
        +                           
                         *
        BCAT &FDATE *BCAT 'To:' *BCAT +                 
                         &
        TDATE *BCAT 'This is for' *BCAT &SYS +          
                         *
        BCAT '..........' *TCAT 'Thanks, Operations.')               
            
        RTVJOBA    USER(&USR)                                         
            
        RTVJOBA    JOB(&JOB)                                          
         
            
        /* Preparing DOC Description........................... */    
            
        IF         COND(&EMAIL *NE '*NONE'THEN( +              
              
        CHGVAR     VAR(&EMAIL1VALUE(&EMAIL *TCAT '@YourEmail.COM')) 
         
            
        CHGVAR     VAR(&DISVALUE('Jobs Report From:' *TCAT +    
                         &
        FDATE *TCAT 'To:' *TCAT &TDATE)             
         
            
        /* Delete TMP File if Exist.........................*/        
            
        DLTF       FILE(QTEMP/QMJRTMP)                            
            
        MONMSG     MSGID(CPF0000)                                 
         
            
        /* Creating physical file in QTEMP..................*/          
            
        CRTPF      FILE(QTEMP/QMJRTMPRCDLEN(140)                
         
            
        /* Copy spool file to physical file ................*/        
            
        CPYSPLF    FILE(JOBRPTP1TOFILE(QTEMP/QMJRTMP) +         
                         
        SPLNBR(*LASTCRTDATE(*LAST)                 
         
            
        /* Copy physical File to PC Document format.........*/        
            
        CPYTOPCD   FROMFILE(QTEMP/QMJRTMPTOFLR(QMJRFLDR) +      
                         
        TODOC(&TOFILREPLACE(*YES)                  
         
            
        /* Sending E-Mail...................................*/             
            
        SNDDST     TYPE(*DOC) +                                        
                         
        TOINTNET((ICMS_SCHEDULER@STC.COM.SA) +            
                         (&
        EMAIL1 *CC)) DSTD('Spooled File') +             
                         
        MSG(&MSGDOC(&TOFILFLR(QMJRFLDR) +             
                         
        SUBJECT('Job Totals Report')                      
            
        MONMSG     MSGID(CPF0000EXEC(DO)                             
         
              
        SNDBRKMSG  MSG('You Cannot send E-MAIL From AS400 +          
                           Please Copy the result and send it from +       
                           your E-Mail'
        TOMSGQ(&JOB)                      
              
        DSPSPLF    FILE(JOBRPTP1SPLNBR(*LASTCRTDATE(*LAST)       
              GOTO       
        CMDLBL(END)                                       
         
            
        ENDDO 
        Last edited by gcraill; February 10, 2009, 03:11 AM.
        Greg Craill: "Life's hard - Get a helmet !!"

        Comment


        • #5
          Re: Email SPool file

          Try:

          Comment


          • #6
            Re: Email SPool file

            Or give BlueSeries a try (http://blueseries.com)

            Regards,
            Bent

            Comment


            • #7
              Re: Email SPool file

              We have this product: http://www.gumbo.com/Licpgm/SpoolMail.html

              It is very reasonable on a small i5.

              Steve

              Comment


              • #8
                Re: Email SPool file

                MMAIL is free and you can get it at http://www.easy400.net you can email the spooled file or convert it to PDF and email it all in one command. you can also email stream files. the price is right and works like a dream...
                Last edited by tomholden; February 25, 2009, 07:47 AM.
                I'm not anti-social, I just don't like people -Tommy Holden

                Comment

                Working...
                X