Dear friend,

command MMAIL/EMBEDSPLF allows to create a HTML stream file containing


  • a message, and
  • a spooled file.

You may then use MMAIL command EMLHTML, EMLNOTE or POSTANOTE to send an e-mail message
where this HTML stream file acts as message body.

In this way you may e-mail a spooled file embedding it into the message body, instead of attaching it.

In this example


  • We used source file MMAIL/TXTSRC, member EMBEDSPLF2
    for message text

    (Press target="_blank">here to display it)
  • we used command

    DSPLIB LIB(QTEMP) OUPUT(*PRINT)

    to generate a QPDSPLIB spooled file
  • then we used command

    MMAIL/EMBEDSPLF TOSTMF('/mmail/html/embedsplf2.html')

    SPLF(QPDSPLIB) SPLFONT('monospace' 100 'gold' 'black' *YES)

    MSGSRCF(MMAIL/TXTSRC) MSGSRCMBR(EMBEDSPLF2) MSGTYPE(*HTML)


    to create the stream file '/mmail/html/embedsplf2.html'

    containing a message body in HTML format.

    That stream file is the one you are reading now.

This HTML stream file body can then be sent with one of the following commands:


  • MMAIL/EMLHTML SUBJECT('Example 2 of an embedded spooled file')

    FROMNAME('Johnny, Cash')

    FROMADDR('jcash@cashisland.com') TO('jerrylou@yahoo.com'/'Jerry'/*TO)

    HTML('/mmail/html/embedsplf2.html')

  • MMAIL/EMLNOTE SUBJECT('Example 2 of an embedded spooled file') NOTESRC(*STMF)

    NOTESTMF('/mmail/html/embedsplf2.html') NOTETYPE(*HTML) DSTTYPE(*FREELIST)

    TO((jerrylou@yahoo.com *TO)
    )
  • MMAIL/POSTANOTE SUBJECT('Example 2 of an embedded spooled file') NOTESRC(*STMF)

    NOTESTMF('/mmail/html/embedsplf2.html') NOTETYPE(*HTML) DSTTYPE(*FREELIST)

    TO((jerrylou@yahoo.com *TO))



Enjoy this tool,


Giovanni



 5770SS1 V7R2M0  140418                   Display Library                                        7/18/20 22.52.49        Page    1  
 Library . . . . . . . . . . . . . . . . :   QTEMP                                                                                  
 Type  . . . . . . . . . . . . . . . . . :   TEST                                                                                   
 Number of objects . . . . . . . . . . . :            7                                                                             
 Library ASP number  . . . . . . . . . . :       1                                                                                  
 Library ASP device  . . . . . . . . . . :   *SYSBAS                                                                                
 Library ASP group   . . . . . . . . . . :   *SYSBAS                                                                                
 Create authority  . . . . . . . . . . . :   *SYSVAL                                                                                
 Text description  . . . . . . . . . . . :                                                                                          
   Object      Type      Attribute             Size  Description                                                                    
   BRWSPL      *FILE     PF                 2658304                                                                                 
   ODFDSPOBJD  *FILE     PF                   28672  Output file for DSPOBJD                                                        
   XSPLF       *FILE     PF                  102400  Spool files                                                                    
   XSPLF1      *FILE     LF                   16384  XSPLF (Spool files) by job name and spool file num                             
   XXXDSPOBJD  *FILE     PF                   28672  Output file for DSPOBJD                                                        
   CURLIB      *DTAARA                         8192  Saved job current library                                                      
   SAVLIBL     *DTAARA                         8192  Saved job library list                                                         
                     Total size :           2949120                                                                                 
                   * * * * *   E N D   O F   L I S T I N G   * * * * *