Sandeep Prajapati
Sandeep Prajapati

Reputation: 97

what are the different ways of sending email in Mainframe?

  1. if we are running SFTP/SMTP to receive files, can we send email using SMTP?

I tried running the below JCL from IBM Documentation.

//BATSMTP  JOB (userid,nn),MSGCLASS=B,PRTY=12,MSGLEVEL=(2,1)
//IEBGENER EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD *
HELO YOURMVS
MAIL FROM:<CAROL@YOURMVS>
RCPT TO:<[email protected]>
RCPT TO:<[email protected]>
DATA
Date: Thur, 26 Mar 92 21:48:57 EST
From: Carol <CAROL@YOURMVS>
To:   <[email protected]>
Cc:   <[email protected]>    Subject: update

 Mike: Cindy stubbed her toe.  Bobby went to 
       baseball camp.  Marsha made the cheerleading team. 
       Jan got glasses.  Peter has an identity crisis. 
       Greg made dates with 3 girls and couldn't 
       remember their names. 
 .
 QUIT
 /*
 //SYSUT2 DD SYSOUT=(B,smtp)
 //*                 |   v
 //*                 v  SMTP address space name for external writer
 //*                SYSOUT class
 //SYSPRINT DD SYSOUT=A

while execution i am getting RC 0012, with SYSPRINT message as: DDNAME SYSUT2 cannot be Opened

Upvotes: 0

Views: 1527

Answers (2)

Steve Ives
Steve Ives

Reputation: 8134

Yes, you can send email using JCL like this to send a valid email stream to the SMTP task vai the external writer. Edit - it would be very odd indeed if you couldn't - that's the whole point of the SMTP task)

However, to ascertain why you are getting the error message you mention, you will need to post the complete joblog as the JCL looks OK except the external writer name (smtp) will usually cause a JCL error if specified in lower-case as per your example.

Your site might be using a different writer name from 'SMTP' but that wouldn't account for the error you are seeing.

Upvotes: 0

cschneid
cschneid

Reputation: 10765

if we are running SFTP/SMTP to receive files, can we send email using SMTP?

Maybe. The SMTP started task may be configured to receive only, though that would be odd. Someone in your installation must answer this question for you, there is no way for anyone on this site to answer that question definitively.

The key is the SYSUT2 SYSOUT DD parameter, which in this case takes the form (class,writer).

Class is one byte, A through Z or 0 through 9, and is defined during JES initialization, meaning a Systems Programmer sets these and their meaning for your installation.

Writer is the name of a started task, one through eight bytes, beginning with a national or alphabetic character followed by seven national, alphabetic, or national characters. that's 29 possibilities for the first position and 39 possibilities for the subsequent seven positions in the started task name.

The name of the writer is designated by someone for your installation who set up, in this case, the SMTP service. The name could be literally anything conforming to the pattern I noted previously, but probably has some meaning embedded in it so it might be SMTP or TCPSMTP or PRODSMTP or SMTPPROD or #SMTP000. But it could be anything.

I suggest your next step is to ask someone in your installation what is used there.

Upvotes: 1

Related Questions