Sending an Email from JCL with attachment
Moderators: Frank Yaeger, DikDude, Moderator Group
email from mainframe
hi,
Iam new to mainframes.....when iam trying to execute a jcl which sends mail ...iam getting maxcc=0 but mail is not been sent.....can any one please tell me wat wrong??? any please tell me wat actually mean HELO *********and wat should i mention after HELO.
//******* 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 **************
MAIL FROM :<mail id 1>
RCPT TO :<mail id 2>
DATA
FROM :<mail id 1>
TO :<mail id 2>
SUBJECT:TEST
HI..... WAT DOING?
REGARDS,
RAJESH
/*
Iam new to mainframes.....when iam trying to execute a jcl which sends mail ...iam getting maxcc=0 but mail is not been sent.....can any one please tell me wat wrong??? any please tell me wat actually mean HELO *********and wat should i mention after HELO.
//******* 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 **************
MAIL FROM :<mail id 1>
RCPT TO :<mail id 2>
DATA
FROM :<mail id 1>
TO :<mail id 2>
SUBJECT:TEST
HI..... WAT DOING?
REGARDS,
RAJESH
/*
thanks,
Rajesh
Rajesh
-
- Member
- Posts: 3
- Joined: Wed Jul 15, 2009 3:18 pm
Erroneous data
Hi All,
I am trying to send an attachment through Mainframes.
I followed the procedure as mentioned by "snatcher".
But I am getting the following error. Is the data at the end in the file erroneous? If yes how to eliminate it. thanks for ur help
1
Unable to deliver mail to some/all recipients.
050 DATA 00000400501 Syntax Error. No Args after 'DATA' command
050 FROM:<abc@xyz.COM> 00000500
I am trying to send an attachment through Mainframes.
I followed the procedure as mentioned by "snatcher".
But I am getting the following error. Is the data at the end in the file erroneous? If yes how to eliminate it. thanks for ur help
1
Unable to deliver mail to some/all recipients.
050 DATA 00000400501 Syntax Error. No Args after 'DATA' command
050 FROM:<abc@xyz.COM> 00000500
regards
aralikatti
aralikatti
-
- Member
- Posts: 3
- Joined: Wed Jul 15, 2009 3:18 pm
All, Just wanted to brief more as i am not getting resolution yet. PLZ reply.
Jcl:
//ATTHMAL JOB (,24),,CLASS=Y,MSGCLASS=A,NOTIFY=&SYSUID
//STEPMX05 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=D
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD DSN=EMAIL.TEST.HELLO,DISP=SHR
// DD DSN=EMAIL.TEST.CODE,DISP=SHR
// DD DSN=EMAIL.TEST.TEXT,DISP=SHR
EMAIL.TEST.HELLO:
HELO JESsmtp
mail from:<XYZ@ABC.COM>
rcpt to:<PQR@ABC.COM>
DATA
FROM: :<XYZ@ABC.COM>
TO: :<XYZ@ABC.COM>
Subject: Test attachment
EMAIL.TEST.CODE:--MIME
CONTENT-TYPE: TEXT/PLAIN;NAME=RECY.TXT
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME=RECY.TXT;
EMAIL.TEST.TEXT: Is my attachment.
Is there any flaw in the code? My files are having same DCB?s. LRECl=80. But there is some number like 00000100 from col 73. Is this the error if so how to turn it off?
The error message is
Unable to deliver mail to some/all recipients.
050 data 00000500
501 Syntax Error. No Args after 'data' command.
Sorry for the big notes!
Jcl:
//ATTHMAL JOB (,24),,CLASS=Y,MSGCLASS=A,NOTIFY=&SYSUID
//STEPMX05 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=D
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD DSN=EMAIL.TEST.HELLO,DISP=SHR
// DD DSN=EMAIL.TEST.CODE,DISP=SHR
// DD DSN=EMAIL.TEST.TEXT,DISP=SHR
EMAIL.TEST.HELLO:
HELO JESsmtp
mail from:<XYZ@ABC.COM>
rcpt to:<PQR@ABC.COM>
DATA
FROM: :<XYZ@ABC.COM>
TO: :<XYZ@ABC.COM>
Subject: Test attachment
EMAIL.TEST.CODE:--MIME
CONTENT-TYPE: TEXT/PLAIN;NAME=RECY.TXT
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME=RECY.TXT;
EMAIL.TEST.TEXT: Is my attachment.
Is there any flaw in the code? My files are having same DCB?s. LRECl=80. But there is some number like 00000100 from col 73. Is this the error if so how to turn it off?
The error message is
Unable to deliver mail to some/all recipients.
050 data 00000500
501 Syntax Error. No Args after 'data' command.
Sorry for the big notes!
regards
aralikatti
aralikatti
two : ( colons ) after FROM , TO might be giving error.aralikattirigvedi wrote:
EMAIL.TEST.HELLO:
HELO JESsmtp
mail from:<XYZ@ABC.COM>
rcpt to:<PQR@ABC.COM>
DATA
FROM: :<XYZ@ABC.COM>
TO: :<XYZ@ABC.COM>
Subject: Test attachment
please check.
Natarajan
Chennai
Chennai
-
- Member
- Posts: 3
- Joined: Wed Jul 15, 2009 3:18 pm
- Priyadarshan
- Member
- Posts: 3
- Joined: Wed Apr 26, 2006 4:53 pm
- Location: Bangalore, India
Hi Subasu / Natarajan,
Are there any limitations on the file size when we try for attachements as well as some text in the mail?
My data size is 100 bytes and I am not able to have both - some text in the body of the mail and the data to be sent as attachment.
Priyadarshan
Are there any limitations on the file size when we try for attachements as well as some text in the mail?
My data size is 100 bytes and I am not able to have both - some text in the body of the mail and the data to be sent as attachment.
Priyadarshan
'There are two choices in life-Take it or leave it !' Deb Ben
-
- Member
- Posts: 1
- Joined: Fri Sep 11, 2009 12:24 pm
- Location: chennai
Hi All,
I am new to Mainframes and i am a learner .
Before posting my Requirement,I tried all the Code Samples Provided in the discussion,
But i didnot find any Solution for the Requirement like sending multiple [say 5 files] as attachements to the mails.
Kindly Provide me an appropriate steps that are to be coded so as to send
5 mainframe files as attachements
thanks
Kishore P.N.R
I am new to Mainframes and i am a learner .
Before posting my Requirement,I tried all the Code Samples Provided in the discussion,
But i didnot find any Solution for the Requirement like sending multiple [say 5 files] as attachements to the mails.
Kindly Provide me an appropriate steps that are to be coded so as to send
5 mainframe files as attachements
thanks
Kishore P.N.R
Main Job
*************
//SETP01 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=D
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD DSN=XXXXX.MAIL.HEADER,DISP=SHR
// DD DSN=XXXXX.MAIL.ATTACH1,DISP=SHR
// DD DSN=XXXXX.MAIL.REPORT1,DISP=SHR
// DD DSN=XXXXX.MAIL.ATTACH2,DISP=SHR
// DD DSN=XXXXX.MAIL.REPORT2,DISP=SHR
/*
XXXXX.MAIL.HEADER :
HELO GECC.2
MAIL FROM:<bharani.s@xxx.com>
RCPT TO:<bharani.s@xxx.com>
DATA
FROM:<bharani.s@xxx.com>
TO:<bharani.s@xxx.com>
Subject: Test attachment
XXXXX.MAIL.ATTACH1 :
--MIME
CONTENT-TYPE: TEXT/PLAIN;NAME=RECY1.TXT
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME=RECY1.TXT;
XXXXX.MAIL.ATTACH2 :
--MIME
CONTENT-TYPE: TEXT/PLAIN;NAME=RECY2.TXT
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME=RECY2.TXT;
XXXXX.MAIL.REPORT1 and XXXXX.MAIL.REPORT2 are the attachments, all are with the same DCB. LREC 80.
Can any one please help me....... i need it very urgently and its very important. please.......... Thanks in Advance.
*************
//SETP01 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=D
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD DSN=XXXXX.MAIL.HEADER,DISP=SHR
// DD DSN=XXXXX.MAIL.ATTACH1,DISP=SHR
// DD DSN=XXXXX.MAIL.REPORT1,DISP=SHR
// DD DSN=XXXXX.MAIL.ATTACH2,DISP=SHR
// DD DSN=XXXXX.MAIL.REPORT2,DISP=SHR
/*
XXXXX.MAIL.HEADER :
HELO GECC.2
MAIL FROM:<bharani.s@xxx.com>
RCPT TO:<bharani.s@xxx.com>
DATA
FROM:<bharani.s@xxx.com>
TO:<bharani.s@xxx.com>
Subject: Test attachment
XXXXX.MAIL.ATTACH1 :
--MIME
CONTENT-TYPE: TEXT/PLAIN;NAME=RECY1.TXT
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME=RECY1.TXT;
XXXXX.MAIL.ATTACH2 :
--MIME
CONTENT-TYPE: TEXT/PLAIN;NAME=RECY2.TXT
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME=RECY2.TXT;
XXXXX.MAIL.REPORT1 and XXXXX.MAIL.REPORT2 are the attachments, all are with the same DCB. LREC 80.
Can any one please help me....... i need it very urgently and its very important. please.......... Thanks in Advance.
Sending an Email from JCL with attachment
Using IEBGENER I did get the examples to work, my question is where can I find the manual that has the SMTP commands syntax.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page