|
|
| Author |
Message |
neeraj_pathak26
New User
Joined: 02 Jun 2006 Posts: 5
|
|
|
|
Hi , I am trying to send a report which is a sequential dataset to certain group as email.
I use a below step to do normal emailing through jcl
| Code: |
//STEP040 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DISP=SHR,DSN=TEST.EMAIL.INFO
// DD DISP=SHR,DSN=TEST.REPORT
//SYSUT2 DD SYSOUT=A,DEST=(destination),
// DCB=(RECFM=F,BLKSIZE=133) |
TEST.EMAIL.INFO has below information
| Code: |
[i][b]HELO XXXXXXX
MAIL FROM:<SOURCE>
RCPT TO:<NEERAJ@REDIFF.COM>
DATA
DATE:
FROM: TESTJOB
TO: GROUP
SUBJECT: TEST REPORT FOR THIS MONTH. [/b][/i] |
and TEST.REPORT has the information which I want to email.
If I use the above step it sends the email having all the report data in the mail it self, but I want to email TEST.REPORT as an attachment.
[/code] |
|
| Back to top |
|
 |
References
|
|
 |
Srinivasa Rao
Active User
Joined: 21 Jun 2005 Posts: 79
|
|
|
|
Hi Neeraj,
You need to specify boundries as below. Try it.
//STEP010 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=B,DEST=SMTP
//SYSUT1 DD *
helo JESNDIXA
mail from:<XXXXXX@JESNDIXA>
rcpt to:<XXXXXXX@XXXXX.COM >
data
From: MAINFRAME
To: XXXXXXXX@XXXXXX.com
Subject: Test attachment
MIME-Version: 1.0
Content-type: multipart/mixed;
boundary="simple boundary"
--simple boundary
CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"
CONTENT-TRANSFER-ENCODING: 7BIT
Hello,
Please find a test email with attachment sent via SMTP:
--simple boundary
--simple boundary
CONTENT-TYPE: APPLICATION/OCTET-STREAM;
CONTENT-DISPOSITION:ATTACHMENT;FILENAME="Vault.doc"
/*
// DD DISP=SHR,DSN=GADMPD.CA1.VMSRPT.BRIT
// DD *
--simple boundary
--simple boundary
CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"
CONTENT-TRANSFER-ENCODING: 7BIT
Regards
-Srinivasa
--simple boundary |
|
| Back to top |
|
 |
neeraj_pathak26
New User
Joined: 02 Jun 2006 Posts: 5
|
|
|
|
Hi Srinivasa,
I tried this one, but It seems it did not work, I got the email but there were no attachment, all details came in email only which I wanted to send as attachment. Along with the email data I got sysin data also
BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"
CONTENT-TRANSFER-ENCODING: 7BIT
HELLO,
PLEASE FIND A TEST EMAIL WITH ATTACHMENT SENT VIA SMTP:
--SIMPLE BOUNDARY
--SIMPLE BOUNDARY
CONTENT-TYPE: APPLICATION/OCTET-STREAM;
CONTENT-DISPOSITION:ATTACHMENT;FILENAME="VAULT.DOC"
| Quote: |
I appreciate your help. |
|
|
| Back to top |
|
 |
Robert Sample
Senior Member
Joined: 06 Jun 2008 Posts: 943 Location: Atlanta, GA
|
|
|
|
This code sends the data as a text attachment:
| Code: |
//MAILPROC EXEC PGM=IEBGENER
//SYSABEND DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(9,SMTP)
//SYSIN DD DUMMY
//*
//SYSUT1 DD *
HELO MAINFRAME.********
MAIL FROM: <MAINFRAME@********>
RCPT TO: <RSAMPLE@********>
DATA
FROM: MAINFRAME@********
TO: ROBERT SAMPLE
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE.TXT
// DD DSN=TTSSRS0.JCL.CNTL(EMAILATT),DISP=SHR
// DD DSN=TTSSRS0.JCL.CNTL(EMAILAT),DISP=OLD |
|
|
| Back to top |
|
 |
neeraj_pathak26
New User
Joined: 02 Jun 2006 Posts: 5
|
|
|
|
Hi Robert,
Thanks for Reply.
Can you please let me know that what the control cards are containing? below are the control cards you have coded in your jcl.
| Quote: |
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE.TXT
// DD DSN=TTSSRS0.JCL.CNTL(EMAILATT),DISP=SHR
// DD DSN=TTSSRS0.JCL.CNTL(EMAILAT),DISP=OLD. |
Also which dataset will go as FILE.TXT in the email?
I appreciate your help! |
|
| Back to top |
|
 |
Robert Sample
Senior Member
Joined: 06 Jun 2008 Posts: 943 Location: Atlanta, GA
|
|
|
|
| The data in TTSSRS0.JCL.CNTL(EMAILATT) becomes the attachment. The EMAILAT member is a single period on a line by itself (required by RFC 2821). |
|
| Back to top |
|
 |
khamarutheen
Senior Member
Joined: 23 Aug 2005 Posts: 678 Location: chennai
|
|
|
|
Hi,
I have 3 reports to send daily. Ihave coded such that to attach a single report. But i am unable to attach all the three report in a single mail. Do any one have an idea on this? Please advise |
|
| Back to top |
|
 |
khamarutheen
Senior Member
Joined: 23 Aug 2005 Posts: 678 Location: chennai
|
|
|
|
| Any positive resolutions???? |
|
| Back to top |
|
 |
khamarutheen
Senior Member
Joined: 23 Aug 2005 Posts: 678 Location: chennai
|
|
|
|
If i try to include
"Hello,
Please find a test email with attachment sent via SMTP:
"
I am not getting in mail. if i try with alternate way it's coming in the attachement itself. Please advise. |
|
| Back to top |
|
 |
Moved: Fri Jul 04, 2008 7:34 pm by superk From JCL to Other Mainframe Topics |
|
|