Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sending mail attachments through JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 64

PostPosted: Wed Dec 12, 2007 4:33 pm    Post subject: Sending mail attachments through JCL
Reply with quote

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
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Dec 12, 2007 4:41 pm    Post subject:
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Dec 12, 2007 5:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 64

PostPosted: Wed Dec 12, 2007 6:01 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts How to sending system service request... lind sh IMS DB/DC 5 Sun Apr 10, 2016 12:02 am
No new posts Issue in sending zip file as mail att... ajithajt JCL & VSAM 8 Thu Apr 07, 2016 9:11 am
No new posts Sending system service calls by AIBTDLI. lind sh IMS DB/DC 1 Wed Mar 16, 2016 6:51 pm
No new posts Sending IMS (DBCTL) command and get r... lind sh CICS 2 Tue Mar 01, 2016 2:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us