How to compose html tags/script format from mainframe batch COBOL? And send that formatted tags in an email attachment through mainframe JCL?
Since you didn't say, I'm assuming that you're using IEBGENER to send an email from the mainframe.
With JCL that looks something like this:
//MAILPROC EXEC PGM=IEBGENER
//SYSABEND DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(A,SMTP)
//SYSIN DD DUMMY
//*
//SYSUT1 DD DSN=USERID.INPUT.CARDS,DISP=SHR
// DD DSN=USERID.DCOL.DATASETS,DISP=SHR
And with input cards that look something like this:
HELO MAILST1
MAIL FROM: <[email protected]>
RCPT TO: <[email protected]>
DATA
FROM: <[email protected]>
TO: <[email protected]>
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-DISPOSITION:ATTACHMENT;FILENAME="TEXT_FILE.TXT"
CONTENT-TYPE: TEXT/PLAIN
or
CONTENT-TYPE: INLINE
or
CONTENT-TYPE: TEXT/HTML
You're going to need the HELO code that your particular mainframe uses.
Here's an example of what might be in TEXT_FILE.TXT:
<BR><FONT SIZE=3 FACE=CALIBRI>
THIS IS AN AUTOMATED MESSAGE GENERATED FROM THE MVS JOB XXXXXX
AT ZZZZZZ TO NOTIFY THE USER ABOUT THE DETAILS OF THE PRODUCTION LOG
FOR DIFFERENT JOBS THAT HAVE EXECUTED OVER THE DAY.
<BR><BR>
As you can see, you just include the HTML as part of the text. It's treated as text on the mainframe and used in an email program that processes HTML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With