Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
No body is being generated

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Fri Jul 23, 2010 8:36 pm    Post subject: No body is being generated
Reply with quote

Hi All,

I am trying to send an attachment (in .csv) format from mainframe to my outlook using SMTP. I am currently using the following code to deliver the mail.
Code:

//SENDNOTE EXEC PGM=IEBGENER                                           
//SYSIN    DD DUMMY                                                     
//SYSABEND DD SYSOUT=*                                                 
//SYSUDUMP DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSUT2   DD SYSOUT=B,DEST=(MVS1,TCPSMTP)                             
//SYSUT1   DD DSN=PRDCTN.MAIL.PROTOCOL,DISP=SHR                   
//         DD DSN=PRDCTN.LOG.D100723.CSV,DISP=SHR                 
//*                                                                     


PRDCTN.LOG.D100723.CSV is the file that is being sent as the attachment.

PRDCTN.MAIL.PROTOCOL contains the following details:
Code:

HELO MVS4.VISA.COM                                                     
MAIL FROM: <aaa@zzz.COM>                                             
RCPT TO: <BBB@ZZZ.COM>                                           
DATA                                                                   
SUBJECT: PMV ONCALL PRODUCTION LOG - 07/23/2010                         
FROM: <AAA@ZZZ.COM>                                                   
TO: <BBB@ZZZ.COM>                                                 
MIME-VERSION: 1.0                                                       
CONTENT-TYPE: TEXT/PLAIN;
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=PROD_LOG.CSV   
CONTENT-TYPE: MULTIPART/MIXED;BOUNDARY="SIMPLE BOUNDARY"               
--SIMPLE BOUNDARY                                                       
CONTENT-TYPE: TEXT/PLAIN;CHARSET="US-ASCII"                             
CONTENT-TRANSFER-ENCODING: 7BIT                                         
NOTICE                                                                 
</BIG></FONT><BR><FONT SIZE=2 FACE=CALIBRI COLOR=RED><I>               
This e-mail (including attachments) is confidential and legally         
privileged and is intended solely for the addressee.                   
Thank you for your help                                                 
</I></FONT></CENTER><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>                                                               
--SIMPLE BOUNDARY--                                                     
--SIMPLE BOUNDARY--                                                     
CONTENT-TYPE: APPLICATION/OCTET-STREAM;                                 
               


My problem is I am getting the attachment with the subject only. But no details is getting populated in the mail body.

It would be of great help if any one can help me in this regards.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jul 23, 2010 8:47 pm    Post subject:
Reply with quote

Why do you have two --SIMPLE BOUNDARY-- statements in a row? Each SIMPLE BOUNDARY delimits a body part so you are sending at least one completely empty attachment.
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Fri Jul 23, 2010 8:54 pm    Post subject:
Reply with quote

I removed one ---SIMPLE BOUNDARY-- statement. The result is the same i.e. only attachment and no email body
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jul 23, 2010 9:10 pm    Post subject:
Reply with quote

I'm looking closer at your SMTP and I have no idea what you think you are doing with this -- but I'm confident that it won't produce what you think it will. These commands have been proven to produce two attachments in an email received by Microsoft Outlook on a PC (as well as by AOL):
Code:
HELO MAINFRAME.xxx.com
MAIL FROM: <aaa@bbb.COM>
RCPT TO: <ccc@ddd.COM>
DATA
FROM:     MAINFRAME
TO:       <whoever>
SUBJECT:  ATTACHMENTS
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=EMAILATT.TXT

//         DD   DISP=SHR,DSN=TTSSRS0.JCL.CNTL(EMAILATT)
//         DD   *
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=EMAILTST.TXT

//         DD   DISP=SHR,DSN=TTSSRS0.JCL.CNTL(EMAILTST)
//         DD   *
--SIMPLE BOUNDARY--
//         DD   DISP=SHR,DSN=TTSSRS0.JCL.CNTL(EMAILAT)
File TTSSRS0.JCL.CNTL member EMAILATT is created as EMAILATT.TXT for attachment 1 -- where is the DD statement pointing to your file that you're wanting to attach? File TTSSRS0.JCL.CNTL member EMAILTST is created as EMAILTST.TXT for attachment 2. After your APPLICATION: OCTET-STREAM you need a DD statement pointing to whatever you want to attach. Furthermore, you will need a SIMPLE BOUNDARY after that attachment before the trailing period.

Finally, it is not clear from what you've posted -- do you have the trailing period in the SMTP commands?
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Fri Jul 23, 2010 9:17 pm    Post subject:
Reply with quote

My simple requirement is I have to send one attachment (DD DSN= PRDCTN.LOG.D100723.CSV,DISP=SHR) with the below mail body:
This e-mail (including attachments) is confidential and legally
privileged and is intended solely for the addressee.
Thank you for your help

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.

Now, my problem is: I am able to send the attachment but the mail body is not generated i.e. I am getting an e-mail with the attachment, FROM Name and Subject line.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Mon Jul 26, 2010 4:52 pm    Post subject:
Reply with quote

Quote:
My simple requirement is I have to send one attachment (DD DSN= PRDCTN.LOG.D100723.CSV,DISP=SHR) with the below mail body:
Sadly, requirements cannot always be met. This appears to be one of those cases. SMTP with MIME tends to get very picky about syntax and everything must be just right for the email to be sent. I've managed to get the inline text and the attachment generated, but there are extra attachments that I have not been able to get rid of. The latest attempt I made is:
Code:
HELO MAINFRAME
MAIL FROM: <MAINFRAME@xxx.COM>
RCPT TO: <aaa@xxx.COM>
DATA
SUBJECT: PMV ONCALL PRODUCTION LOG - 07/23/2010
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"

--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: INLINE

NOTICE
</BIG></FONT><BR><FONT SIZE=2 FACE=CALIBRI COLOR=RED><I>
THIS E-MAIL (INCLUDING ATTACHMENTS) IS CONFIDENTIAL AND LEGALLY
PRIVILEGED AND IS INTENDED SOLELY FOR THE ADDRESSEE.
THANK YOU FOR YOUR HELP
</I></FONT></CENTER><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>

--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=PROD_LOG.CSV

//         DD   DISP=SHR,DSN=<file to be attached>
//         DD   DISP=SHR,DSN=<trailing period file>
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Mon Jul 26, 2010 6:12 pm    Post subject:
Reply with quote

Hi Robert,

I used the below mentioned code to successfully generate the mail as per my requirement:
Code:

SUBJECT: PMV Oncall Production Log - $MM/$DD/$YYYY                   
MIME-VERSION: 1.0<br>                                                 
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY=MIMEBOUNDARY                 
--MIMEBOUNDARY                                                       
CONTENT-TYPE: TEXT/HTML                                               
                                                                     
</I></FONT></CENTER><BR><FONT SIZE=3 FACE=CALIBRI>                   
This is an automated message generated from the MVS Job XXXXXXXX     
at MVS4plex to notify the user about the details comprising of start 
time, end time, execution time and various other counts of AAAAAAAA, 
BBBBBBBB and CCCCCCCC job for the odate $MM$DD herewith the mail.     
<BR>                                                                 
</FONT><FONT SIZE=3 FACE=CALIBRI>                                     
                                                                     
<BR>                                                                 
For more info, please contact <B>TEAM NAME</B>. 
<BR><LEFT> TEAM SIGNATURE   
</FONT></LEFT>                                                       
                                                                     
<BR><BIG><CENTER><FACE=CALIBRI>                                       
NOTICE                                                               
</BIG></FONT><BR><FONT SIZE=2 FACE=CALIBRI COLOR=RED><I>             
This e-mail (including attachments) is confidential and legally       
privileged and is intended solely for the addressee.                 
Unless it is addressed to you, you may not read, copy, use or store it
in any way, or permit others to.                                     
                                                   
Thank you for your help                                               
                                                                     
--MIMEBOUNDARY                                                       
CONTENT-TYPE: TEXT/PLAIN                                             
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=Prod_Log.csv               
/*
//    DD DSN=<FILE ATTACHMENT>
//    DD *
.
/*
//*                                                     


Thanks for your help.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Mon Jul 26, 2010 6:41 pm    Post subject:
Reply with quote

Glad to hear it worked!
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Reading data from PS file and send it... rajatbagga All Other Mainframe Topics 18 Fri Sep 23, 2016 12:51 pm
No new posts Any body aware of CAP-COBOL language? Sachin Raghuwanshi COBOL Programming 4 Tue Aug 02, 2016 9:34 am
No new posts XML generated from cobol is displayin... vangeti COBOL Programming 2 Wed Aug 19, 2015 5:16 pm
No new posts Validation of reports generated in As... deb_parthas PL/I & Assembler 3 Wed Jul 30, 2014 3:18 pm
No new posts How to write ISPF panel body in the R... chaoj CLIST & REXX 4 Sat Mar 15, 2014 9:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us