Page 1 of 1

Re: sending email from jcl

PostPosted: Wed Jun 09, 2010 6:46 pm
by nallasivam
need a correct jcl to send email via jcl....
pls help me...

Re: sending email from jcl

PostPosted: Wed Jun 09, 2010 7:49 pm
by Robert Sample
//STEP1    EXEC PGM=IEBGENER
//SYSPRINT DD   SYSOUT=*
//SYSUT2   DD   SYSOUT=(9,SMTP)
//SYSIN    DD   DUMMY
//SYSUT1   DD   *
HELO <mainframe name>
MAIL FROM: <xxxxxxxx@xxx.xxx>
RCPT TO: <xxxxxxxx@xxx.xxx>
DATA
FROM: <whoever>
TO: <whoever>
Subject: <subject line>
data lines
.
/*
Comments:
1. The sysout class is specific to site -- we use 9; a lot of sites use B, but only your site support group can tell you for sure.
2. The sysout started task name is specific to site -- we use SMTP but only your site support group can tell you for sure
3. HELO, MAIL FROM, RCPT TO, and DATA lines are required. Multiple recipients require multiple RCPT TO lines, one per recipient
4. Line numbers are not part of SMTP and will cause problems.
5. The data lines must be followed by a single line with a period on it and nothing else. If the period is missing, the email is not valid and will not be sent.
6. This is instream -- the data could come from a file. The record limit is 998 characters (1000 minus the carriage return and line feed added for PC systems)
7. The <> around the MAIL FROM and RCPT TO addresses are not optional -- they are part of the standard

Re: sending email from jcl

PostPosted: Wed Jun 09, 2010 9:09 pm
by MrSpock
Robert, I don't know if it would help you to reduce the amount of typing you need to do everytime this question is asked, but maybe you could just point them to the MVSMAIL page link:

MVSMAIL.