Send email from JCL in Mainframe

How to send a Mainframe file to a mailbox using a JCL? Mailbox could be any? What parameters need to be passed in the JCL like - Host address, mail address, etc..?

Showing Answers 1 - 12 of 12 Answers

Anarchy

  • Jan 30th, 2008
 

Try this out

//YOURID0A JOB,P966EXTRCTKCC,REGION=4096K,MSGCLASS=H,CLASS=T,
// NOTIFY=&SYSUID
//SENDNOTE EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD *
HELO MVSHOST
MAIL FROM: (note - keep < > intact)

RCPT TO:<receiversemail.com>
DATA
FROM: youremail.com
TO: receiversemail.com
SUBJECT: Test
Message from MVS using SMTP CT Me
I have sent this message
through mainframe interesting?

  Was this answer useful?  Yes

dhs01

  • Apr 15th, 2009
 

I think you would first need to get the email to the mainframe. One way would be to put the email into a notepad or some other file and FTP it to a file on the mainframe. 

  Was this answer useful?  Yes

The other answers are fine as far as they go.  They both assume SMTP is up and running unter TCPIP.
SMPT polls a specific output queue and forwards any output in that queue to the next hop as defined in the SMTP started task input parms.

You would code up a gener to dump your output to that queue.  The input to the gener would be coded as on the SMTP RFC.

 

  Was this answer useful?  Yes

arsagg

  • Oct 21st, 2010
 

//<<<>>>
//SENDNOTE EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD *
HELO MVSHOST
MAIL FROM:
RCPT TO:
DATA
FROM:  email id
TO: email id
SUBJECT: TEST MESSAGE FROM MVS USING SMTP
THIS IS A LINE IN THE BODY OF THE NOTE.
/*
----------------
In this you need to change the NODE of the control statements. Here is "MVSHOST", check out your JES2 log next to N O D E and put it here.
Then
change the to and from field, Similarly MAIL FROM and RCPT TO

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions