Page 1 of 1

SMTP JCL

PostPosted: Thu Nov 04, 2010 2:00 pm
by jaggz
Hi,

I prepared a jcl program for sending an email from mainframe to my personal email account. Below was the jcl and after submission i got a return code of 00.
Even after the successful return code i am unable to receive email from mainframe. could you please explain me the reason for not receiving the email from mainframe.


//A255209J JOB MSGCLASS=X,MSGLEVEL=(1,1),CLASS=T,
// REGION=5M,NOTIFY=&SYSUID
//IEBGENER EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD *
helo yourmvs
mail from: <jagadishan.p@gmail.com>
rcpt to: <jagadishan.p@gmail.com>
rcpt to: <jagadishan.p@gmail.com>
Cc: <rick@gmail.com> Subject: Hola
Jags: guten tag. was ist ihre namn.
stardator ist kuss. Always
hej hej.
.
quit
/*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSOUT DD SYSOUT=A
//SYSPRINT DD SYSOUT=A
//

Re: SMTP JCL

PostPosted: Thu Nov 04, 2010 2:35 pm
by NicC
No such thing as a 'jcl program' even though the L in jcl does stand for Language the J and C stand for Job and Control. JCL provides a means of telling the OS what program you want to run and what resources it needs.

I know very little about FTP from mainframe but there are several posts about doing this. Have you searched for them?

Re: SMTP JCL

PostPosted: Thu Nov 04, 2010 3:01 pm
by jaggz
Sorry for wrong representation of JCl as program. I searched it and found that the SMTP server has to be configured accordingly for recieving the email from mainframes. Here in our shop it is prohibited due to policy.

Re: SMTP JCL

PostPosted: Thu Nov 04, 2010 3:43 pm
by NicC
So you could have saved some time by searching first, as the rules state that you should. Oh well, it is your time wasted.

Re: SMTP JCL

PostPosted: Thu Nov 04, 2010 5:03 pm
by Robert Sample
Even if not a policy issue, your SMTP commands are not coded as per RFC 2821 and RFC 2822 (hint: Google is your friend). For example, without a DATA command there will be no email sent, period.

Re: SMTP JCL

PostPosted: Fri Nov 05, 2010 1:04 am
by mainframe_Puli
HI Jaggz,

I am new to Mainframe field, but few days before I was working with one of my senior regarding SMTP.
As per my knoweldge your JCL doesnt doesnt have the key word DATA.

//A255209J JOB MSGCLASS=X,MSGLEVEL=(1,1),CLASS=T,
// REGION=5M,NOTIFY=&SYSUID
//IEBGENER EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD *
helo yourmvs
mail from: <jagadishan.p@gmail.com>
rcpt to: <jagadishan.p@gmail.com>
rcpt to: <jagadishan.p@gmail.com>
Cc: <rick@gmail.com>
Subject: Hola
Content-type: text plain;
data
Jags: guten tag. was ist ihre namn.
stardator ist kuss. Always
hej hej.
.
quit
/*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSOUT DD SYSOUT=A
//SYSPRINT DD SYSOUT=A
//....

I'm not pretty much sure whether this will produce desired result, please just take a look at this and also you have to do some SMTP configurations....

Friend suggest me if there's any mistake

Re: SMTP JCL

PostPosted: Fri Nov 05, 2010 1:19 am
by Robert Sample
//A255209J JOB MSGCLASS=X,MSGLEVEL=(1,1),CLASS=T,
// REGION=5M,NOTIFY=&SYSUID
//IEBGENER EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD *
helo yourmvs
mail from: <jagadishan.p@gmail.com>
rcpt to: <jagadishan.p@gmail.com>
rcpt to: <jagadishan.p@gmail.com>
Cc: <rick@gmail.com> This is not allowed -- CC recipients must be RCPT TO: and have the CC after the DATA statement
Subject: Hola Invalid here -- must occur AFTER the DATA
Content-type: text plain; Invalid here -- must occur AFTER the DATA
data
Jags: guten tag. was ist ihre namn.
stardator ist kuss. Always
hej hej.
.
quit
/*
//SYSUT2 DD SYSOUT=(B,SMTP) B depends on the site. SMTP is the started task name and depends on the site.
//SYSOUT DD SYSOUT=A
//SYSPRINT DD SYSOUT=A
//....