IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

No body is being generated


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 23, 2010 8:47 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 23, 2010 9:10 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jul 26, 2010 4:52 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jul 26, 2010 6:41 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Problem while sending special charact... JCL & VSAM 4
No new posts OUTREC OVERLAY different to INCREC ge... SYNCSORT 8
No new posts Moving a PS file as body of a mail! JCL & VSAM 4
No new posts Reading data from PS file and send it... All Other Mainframe Topics 18
No new posts Any body aware of CAP-COBOL language? COBOL Programming 4
Search our Forums:

Back to Top