View previous topic :: View next topic
|
Author |
Message |
neeraj_pathak26
New User
Joined: 02 Jun 2006 Posts: 7
|
|
|
|
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 |
|
|
Srinivasa Rao
New User
Joined: 21 Jun 2005 Posts: 75
|
|
|
|
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: 7
|
|
|
|
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
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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: 7
|
|
|
|
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
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
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
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
Any positive resolutions???? |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
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 |
|
|
jack.arden
New User
Joined: 30 Jan 2009 Posts: 3 Location: New Jersey
|
|
|
|
I have tried the above approach and the report is appearing in the body of the e-mail not as an attachment. Also, this only works if the dataset to be sent is 80 bytes, if it is 133 as any report I get a JCL error. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
If you're concatenating datasets, make sure you follow the rules of concatenation (they should all have the same RECFM and LRECL) in your job ... |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
Quote: |
this only works if the dataset to be sent is 80 bytes, if it is 133 as any report I get a JCL error. |
I doubt this would result in a JCL error, maybe a non zero return code or an abend.
Gerry |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello Jack and welcome to the forum,
It will probably help if you post the jcl/control statements used along with the actual error message(s) and the id's that go with them. . .
When posting jcl, code, etc, it is best to use copy/paste and the "Code" tag (top center of the reply panel). Use Preview see how your post will appear to the forum and when you are satisfied, Submit.
Please do not attach screenshots. . . |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I've got someone at work that uses this format to send 998-byte records. The SYSUT1 DD statement points to a DSNAME with LRECL=998, and the concatenated files are both LRECL=998. This works fine in production every day for us. The MAIL FROM and RCPT TO fields are different but they and the other statements are all part of the LRECL=998 dataset. |
|
Back to top |
|
|
jack.arden
New User
Joined: 30 Jan 2009 Posts: 3 Location: New Jersey
|
|
|
|
The jcl submitted is:
Code: |
//EXT2MAIL 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 CHAR.MVS.US.XXX.COM
MAIL FROM: <JARDEN@XXX.COM>
RCPT TO: <JARDEN@XXX.COM>
DATA
TO: <JARDEN@XXX.COM>
FROM: <APP1JJAX JOB>
SUBJECT: TEST E-MAIL NOTIFICATION
===============================================
JOB APP1JJAX COMPLETED (SEE ATTACHMENT)
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE.TXT
// DD DSN=APP.APP1JJA.REPORT1,DISP=SHR
// DD DSN=APP.APP1JJA.JCL(PERIOD),DISP=SHR
//
|
The e-mail received is:
===============================================
JOB APP1JJAX COMPLETED (SEE ATTACHMENT)
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE.TXT
N828TEST TEST REPORT
NAME ADDRESS
JOHN DOE 123 MAIN STREET ANYTOWN, NJ 07000
JANE DOE 999 ANOTHER RD ATOWN, NY 11200
.
Notice the "." at the end. What I want is for the part starting at N828TEST to be in an attachment. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Where's all of the MIME protocol code? All I see is the SMTP protocol code. There looks to be a lot missing, unless it's included in one of the concatenated datasets. |
|
Back to top |
|
|
jack.arden
New User
Joined: 30 Jan 2009 Posts: 3 Location: New Jersey
|
|
|
|
MIME protocol code??? Please provide sample |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Nair47
New User
Joined: 13 Jun 2009 Posts: 2 Location: vizag
|
|
|
|
can any one please tell me....wat is this helo ***** means.
when iam trying to execute the code iam getting maxcc=0, but mail is not been sent.
//G107525J JOB ,,NOTIFY=&SYSUID,CLASS=B,MSGLEVEL=(1,1),MSGCLASS=X
//IEBGENER EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSOUT DD SYSOUT=*
//SYSUT1 DD *
HELO 192.168.100.74
MAIL FROM :<mailid1>
RCPT TO :<mailid2>
DATA
FROM :<mailid1>
TO :<mailid2>
SUBJECT:TEST
HI..... WAT DOING?
REGARDS,
RAJESH
/* |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
To find out what the HELO means, pull up the IETF document RFC 2821 and read it. This document gives you the exact specifications for Internet emails and the different options there of. Google can help you find it.
How do you know the mail has not been sent? Since you obfuscated the precise email address, I recommend you contact your site support group and have them check the SMTP job output to see if your email did, indeed, get sent. Note that having the email go out of the mainframe does not mean you will see it at <mailid2>. That would depend upon whether the mail server was set up appropriately to handle mainframe emails. You really, really, really must get site support people involved to resolve this since there are a number of areas where an email can go awry and only they can help you figure out what is going on. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
In addition to what Robert mentioned, it may be that the mail was sent, but was denied some way (treated as junk, deleted, rejected, etc) by the receiving e-mail system.
Quote: |
You really, really, really must get site support people involved |
Yup, you really really should. . . |
|
Back to top |
|
|
Nair47
New User
Joined: 13 Jun 2009 Posts: 2 Location: vizag
|
|
|
|
hi,
thank u so much....one of my freind had written the same code....but this worked for him.....and i recieved mail sent by him through main frame....every thing was fine...but the thing is he has sent me using vsam file......but this didnot work for me when i tried for it directly....the main frame server name and mails every thing supports the mainframe mails.... |
|
Back to top |
|
|
Srinivas46
New User
Joined: 03 Oct 2009 Posts: 4 Location: Chennai
|
|
|
|
Hi,
I was able to use the code to send an email with attachement as a Text file. Now, my requirement is as follows:
I have a huge MS word document (around 20 MB) which was compressed using ZIP and then FTP'ed to a mainframe dataset in Binary format.
I want an email to be sent with the MS Word doc (or the ZIP file) as an attachment. Can this be done thru JCL ?
Please let me know if it can be done thru any other means.
Thanks,
Srinivas
Robert Sample wrote: |
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Is XMITIP available on your system? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
I have a huge MS word document (around 20 MB) which was compressed using ZIP and then FTP'ed to a mainframe dataset in Binary format.
I want an email to be sent with the MS Word doc (or the ZIP file) as an attachment. Can this be done thru JCL ? |
No -- JCL does nothing but execute programs. If you wanted to use a utility like IEBGENER to do this, that would work. But since JCL does nothing by itself, you cannot do anything "thru JCL".
Even if you use a utility such as IEBGENER, you have to consult with your site support group. They have established a limit on the size of the SMTP email (the default is 512K), and unless that limit is larger than the size of the document you are attempting to email, it cannot be sent via SMTP. |
|
Back to top |
|
|
|