Email from AS400 with Attachment
Email Spool as PDF
Convert Spool to PDF (Need 5770TS1 option 01 installed in the machine/LPAR)
CPYSPLF FILE(SPLFfilename) TOFILE(*TOSTMF) JOB(jobname/user/jobnumber) SPLNBR(*ONLY) TOSTMF('ifs or stream filename.pdf') WSCST(*PDF) STMFOPT(*REPLACE)
QSYS/SNDSMTPEMM RCP((mail@domain.COM)) SUBJECT('test email') ATTACH(('ifs or stream filename.pdf'))
Email a file as a spread sheet CSV
CPYTOIMPF FROMFILE(QTEMP/SQLWORK) TOSTMF('IFS Filenm.csv') MBROPT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*CRLF) ADDCOLNAM(*SYS)
QSYS/SNDSMTPEMM RCP((mail@domain.COM)) SUBJECT('test email') ATTACH(('ifs or stream filename.CSV'))
Email to multiple email ids
QSYS/SNDSMTPEMM RCP((mail@domain.COM) (mail1@domain.COM)(mail2@domain.COM *BCC)) SUBJECT('test email') ATTACH(('ifs or stream filename.CSV'))
Comments
Post a Comment