View previous topic :: View next topic
|
Author |
Message |
picus_mf Warnings : 1 New User
Joined: 09 Jun 2006 Posts: 52
|
|
|
|
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 |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Search the Froum for "attachment" and author as "Robert Sample" you'll get enough hits to work with. |
|
Back to top |
|
 |
picus_mf Warnings : 1 New User
Joined: 09 Jun 2006 Posts: 52
|
|
|
|
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 |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
 |
picus_mf Warnings : 1 New User
Joined: 09 Jun 2006 Posts: 52
|
|
|
|
yes I observed the blank lines after the CONTENT-DISPOSITION and tested accordingly. But no luck. |
|
Back to top |
|
 |
Ronald Burr
Active User

Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
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 |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
 |
|