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

Multiple attachments with IEBGENER


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
picus_mf
Warnings : 1

New User


Joined: 09 Jun 2006
Posts: 52

PostPosted: Thu Jul 22, 2010 5:50 pm
Reply with quote

Hi,
I have to send e-mails with multiple attachments. It worked with with single attachment but not working for multiple. This is what I have tried

Code:

//EMAIL22  EXEC  PGM=IEBGENER                                         
//SYSPRINT DD  SYSOUT=*                                               
//SYSIN    DD  DUMMY                                                 
//SYSUT2   DD  SYSOUT=(2,SMTP)                                       
//SYSUT1   DD  *
 HELO  MASTER                 
 MAIL FROM: <IDM@ABC.com>
 RCPT TO:   <IDM@ABC.com>
DATA                         
SUBJECT: LIST OF ELEMENTS IN TEST1 - REPORT<EOM>         
MIME-VERSION: 1.0                                           
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"   
--SIMPLE BOUNDARY                                           
CONTENT-TYPE: TEXT/PLAIN                                     
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=TEST1_COBB.TXT 
//    DD  DISP=SHR,DSN=A.B.C.1  (data for first att)
 --SIMPLE BOUNDARY                                           
 CONTENT-TYPE: TEXT/PLAIN                                     
 CONTENT-DISPOSITION: ATTACHMENT; FILENAME=TEST1_COBB_2.TXT
//    DD  DISP=SHR,DSN=A.B.C.2 (data for second att)
 --SIMPLE BOUNDARY               
//    DD  DISP=SHR,DSN=A.B.C.3 (period operator on rowXcol (1x1) and nothing else)

The MAX CC is 0, but I am not getting any mails to the mentioned id.

NOTE: I have changed the e-mail ids and data set names in this post. I confirm they do not have any spelling mistakes and are valid.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jul 22, 2010 5:57 pm
Reply with quote

Search the Froum for "attachment" and author as "Robert Sample" you'll get enough hits to work with.
Back to top
View user's profile Send private message
picus_mf
Warnings : 1

New User


Joined: 09 Jun 2006
Posts: 52

PostPosted: Thu Jul 22, 2010 6:02 pm
Reply with quote

Yes Anuj, the piece of code for multiple attachments was taken from his post. The job is completed with RC 0 but mail is not triggered.
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: Thu Jul 22, 2010 6:56 pm
Reply with quote

If you can look at the SMTP started task, see what messages, if any, appear when you submit the job. If you cannot look at the output, you will need to get your site support group to look at the output for you.

One possibility is to add the parameter DEBUG to your SMTP configuration file and restart SMTP. This provides detailed information about what is going back and forth with SMTP. Your site support group would have to do this but it can be very beneficial in resolving issues as SMTP is not very explicit as to problems.

I do note one difference between my post and yours -- I had blank lines in certain spots. IIRC, those blank lines are not optional. You might try adding them to see if you get better results.
Back to top
View user's profile Send private message
picus_mf
Warnings : 1

New User


Joined: 09 Jun 2006
Posts: 52

PostPosted: Fri Jul 23, 2010 7:36 pm
Reply with quote

yes I observed the blank lines after the CONTENT-DISPOSITION and tested accordingly. But no luck.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Fri Jul 23, 2010 7:59 pm
Reply with quote

Just an observation:
Robert's sample also specified FROM: and TO: designators between the DATA and SUBJECT lines, which you did not do
Code:
DATA
FROM:     MAINFRAME@XXX.COM
TO:       ROBERT.SAMPLE@XXX.COM
SUBJECT:  TEST ATTACHMENT

Perhaps those statements are important to a successful operation?
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: Sat Jul 24, 2010 1:00 am
Reply with quote

I tested with your JCL and got it running as follows:
Code:
 HELO  MASTER                 
 MAIL FROM: <IDM@ABC.com>
 RCPT TO:   <IDM@ABC.com>
DATA                         
SUBJECT: LIST OF ELEMENTS IN TEST1 - REPORT<EOM>         
MIME-VERSION: 1.0                                           
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"   
--SIMPLE BOUNDARY                                           
CONTENT-TYPE: TEXT/PLAIN                                     
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=TEST1_COBB.TXT

//    DD  DISP=SHR,DSN=A.B.C.1  (data for first att)
//    DD  *
--SIMPLE BOUNDARY                                           
CONTENT-TYPE: TEXT/PLAIN                                     
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=TEST1_COBB_2.TXT

//    DD  DISP=SHR,DSN=A.B.C.2 (data for second att)
//    DD  DISP=SHR,DSN=A.B.C.3 (period operator on rowXcol (1x1) and nothing else)
The four specific changes that were required to get it working were:
1. Added blank line after CONTENT-DISPOSITION (no, I don't know why this is required but it doesn't seem to work without the blank line)
2. Made sure all data started in column 1 -- you had --SIMPLE BOUNDARY starting in column 2, which didn't work for me
3. You were missing some // DD * lines to indicate the concatenation; otherwise, SYSIN is assumed and duplicated within the step -- not a good thing.
4. Removed final --SIMPLE BOUNDARY before the trailing period -- I thought it was needed but mine ran without 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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top