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
 
How to Email two attachments using SMTP

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to Email two attachments using SMTP
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    Post subject: Reply to: How to Email two attachments using SMTP
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: 8166
Location: East Dubuque, Illinois, USA

PostPosted: Fri Mar 26, 2010 5:27 pm    Post subject:
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: 8166
Location: East Dubuque, Illinois, USA

PostPosted: Fri Mar 26, 2010 5:29 pm    Post subject:
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    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 sending email from jcl using the mail... niloyarp JCL & VSAM 5 Tue Oct 10, 2017 12:32 pm
No new posts Adding a userid to SMTP Security table Yolanda Harvey JCL & VSAM 1 Sun Aug 13, 2017 6:16 pm
No new posts EMAIL using IEBGENER - SMTP parasmalik20 JCL & VSAM 4 Tue May 23, 2017 12:19 am
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Mail via SMTP with an image? Mike 1304 JCL & VSAM 4 Thu Jan 26, 2017 2:01 pm

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