The following sample program uses the MAILSPLF command:
****************************************************************************************
PGM

DCL VAR(&RTNSPOOL) TYPE(*CHAR) LEN(10)
DCL VAR(&RTNJOB) TYPE(*CHAR) LEN(10)
DCL VAR(&RTNUSER) TYPE(*CHAR) LEN(10)
DCL VAR(&RTNJNBR) TYPE(*CHAR) LEN(6)
DCL VAR(&RTNSPLNBR) TYPE(*CHAR) LEN(6)

/******************************************************/
/* RUN REPORT PROGRAM */
/******************************************************/
CALL PGM(RPT100)

/******************************************************/
/* RETRIEVE SPOOL FILE INFO FOR REPORT */
/******************************************************/
ERSNUM SPLF(RPT100P) JOB(*) SPLNBR(*LAST) +
RTNSPLF(&RTNSPOOL) RTNJOBNAME(&RTNJOB) +
RTNJOBUSER(&RTNUSER) RTNJOBNUM(&RTNJNBR) +
RTNSPLNUM(&RTNSPLNBR)

/******************************************************/
/* MAIL SELECTED REPORT */
/******************************************************/
MAILSPLF FILE(&RTNSPOOL) +
JOB(&RTNJNBR/&RTNUSER/&RTNJOB) +
SPLNBR(&RTNSPLNBR) +
TOADDRESS([email protected]) +
FRADDRESS([email protected]) +
SUBJECT('AS/400 Report') CONVTYPE(PDF) +
SMTPHOST(LOCALHOST)
ENDPGM 

****************************************************************************************
Still have questions? We can help. Submit a case to technical support

Last Modified On:
You don't have the appropriate permissions.
No, open a new Support Case