View previous topic :: View next topic
|
Author |
Message |
ravikumar15
New User
Joined: 27 Mar 2006 Posts: 68
|
|
|
|
Hi,
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 *
HELO N01A
MAIL FROM: <ravi.desai@rediffmail.com>
RCPT TO: <ravi.desai@yahoo.com>
DATA
TO <ravi.desai@yahoo.com>
SUBJECT: TEST MAIL
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="BOUNDRY1"
--BOUNDRY1
CONTENT-TYPE:TEXT/PLAIN;CHARSET=US-ASCII
CONTANT-TRANSFER-ENCODING: 8 bit
HELLO
ATTACHED IS YOUR TEST REPORT
CONTENT-TYPE: TEXT/PLAIN;
CONTENT-DISPOSITION: INLINE;
--BOUNDRY1
CONTENT-TYPE: TYPE/PLAIN; NAME="REPORT1.TXT"
CONTENT-DISPOSITION:ATTACHMENT;FILENAME="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.
Thanks in advance,
Ravi |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
It should work if the record length of the file ABC.XYZ.BODY 80.
Or
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. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Sample mail JOB with attachment
Code: |
//STEP1 EXEC PGM=IEBGENER
//*
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSUT2 DD SYSOUT=(A,SMTP)
//SYSUT1 DD *
HELO MVSHOST
MAIL FROM:<SOURCE@MAIL.COM>
RCPT TO:<DESTINATINATON@GMAIL.COM>
DATA
FROM: <SOURCE@MAIL.COM>
TO: DESTINATINATON@GMAIL.COM
SUBJECT: FILE
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED;
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=REPORT1.TXT
CONTENT-TYPE: TEXT/HTML
// DD DISP=SHR,DSN=ABC.XYZ.BODY |
http://www.planetmvs.com/mvsmail/ |
|
Back to top |
|
|
ravikumar15
New User
Joined: 27 Mar 2006 Posts: 68
|
|
|
|
I replaced the instream data with the control card of record length 80. Both the files (control card containing the smtp commands and the file ABC.XYZ.BODY is of record length 80).
But it still the same. The attached file is blank. Is there any other option which i am missing out. |
|
Back to top |
|
|
|