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

How to Email two attachments using SMTP


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sudib19

New User


Joined: 06 Feb 2007
Posts: 29
Location: Noida

PostPosted: Fri Mar 26, 2010 5:14 pm
Reply with quote

Hi,

How do I email two FB Files in a single step using SMTP. XMITIP is not installed in our system. Currently the code that I have is as follows
Code:

//SENDMAIL EXEC     PGM=IEBGENER                                 
//SYSIN    DD  DUMMY                                             
//SYSUT1   DD  DSN=XX.JJ(MAIL),DISP=SHR           
//             DD  DSN=XX.ACCNTS,DISP=SHR     
//              DD  DSN=XX.JJ(MAIL1),DISP=SHR
//              DD  DSN=XX.ACCNTS1,DISP=SHR   
//SYSUT2   DD  SYSOUT=(B,SMTP),DCB=(LRECL=137)                   
//SYSIN    DD  DUMMY                                             
//SYSPRINT DD  SYSOUT=*                                           
//SYSPRINT DD  SYSOUT=*                                           


The contents of MAIL and MAIL1 are as follows
MAIL
Code:

HELO PRD370                                               
MAIL FROM:<XX@XX.COM>                             
RCPT TO:<XX@YY.COM>                             
DATA                                                     
SUBJECT: Hello
TO:XX@YY.com                                   
MIME-VERSION: 1.0                                         
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY                                         
CONTENT-TYPE: TEXT/PLAIN                                 
CONTENT-TRANSFER-ENCODING: QUOTED-PRINTABLE               
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=ACCTS.CSV   

                                                         

MAIL1
Code:

MIME-VERSION: 1.0                                               
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"       
--SIMPLE BOUNDARY                                               
CONTENT-TYPE: TEXT/PLAIN                                         
CONTENT-TRANSFER-ENCODING: QUOTED-PRINTABLE                     
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=ACCTS1.CSV               

                                                                 


Thanks a lot for your help
Sudip Bhattacharya
Back to top
View user's profile Send private message
sudib19

New User


Joined: 06 Feb 2007
Posts: 29
Location: Noida

PostPosted: Fri Mar 26, 2010 5:20 pm
Reply with quote

Just to give you a better idea as to what is happening now.

The entire content of ACCTS and ACCTS1 are coming in the CSV file and only one attachment is coming. The LRECL of the files and the control cards is 137.

Sorry for missing that out in my previous post.

Thanks
Sudip
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 Mar 26, 2010 5:27 pm
Reply with quote

This worked for me and generated two attachments:
Code:
DATA
FROM:     MAINFRAME@XXX.COM
TO:       ROBERT.SAMPLE@XXX.COM
SUBJECT:  TEST ATTACHMENT
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)
//
I don't think you have enough boundaries.
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 Mar 26, 2010 5:29 pm
Reply with quote

I was missing the first --SIMPLE BOUNDARY on my first test job, and got the same results you did -- one attachment with everything in it.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts REXX to send an email in Mainframe wi... CLIST & REXX 3
No new posts REXX to send an email in Mainframe CLIST & REXX 4
No new posts Problem while sending special charact... JCL & VSAM 4
No new posts TXT2PDF and then SMTP email a PDF JCL & VSAM 4
No new posts Send email without SMTP All Other Mainframe Topics 5
Search our Forums:

Back to Top