I am trying to send an email with attachment from mainframe. I am able to send the mail but there is some problem with the attachment. I am using the following code
//STEP001 EXEC PGM=IEBGENER
//SYSUT1 DD *
MAIL FROM: <firstname.lastname@example.org>
RCPT TO: <email@example.com>
SUBJECT: TEST MAIL
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="BOUNDRY1"
CONTANT-TRANSFER-ENCODING: 8 bit
ATTACHED IS YOUR TEST REPORT
CONTENT-TYPE: TYPE/PLAIN; NAME="REPORT1.TXT"
// DD DSN=ABC.XYZ.BODY,DISP=SHR
I want the file ABC.XYZ.BODY as attachment in the mail. I am getting a mail with the attachment REPORT1.txt. But that file is blank,
Can any one please let me know why that is blank.
If the code needs some change to include the data in the attached file, please let me know.
It should work if the record length of the file ABC.XYZ.BODY 80.
Instead of giving instream data store that in a flat file of same length as ABC.XYZ.BODY and run the job. Do let us know if it works.