Home > Archive > Cobol > September 2004 > Email from m/f Batch
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Email from m/f Batch
|
|
| Old Mainframer 2004-09-14, 8:55 am |
| Does anyone know of how to send an email (to multiple recipients) from
within a mainframe program ? Does it have to be written to a file for
JCL to send or can it be done directly ? Either way, examples of code
welcomed !
--
posted via MFF : http://www.MainFrameForum.com - USENET Gateway
| |
| Hans Kok 2004-09-14, 8:55 am |
| We used this jcl:
//GENMAIL EXEC PGM=IEBGENER //SYSUT1 DD *
TEST THIS IS LINE 1 TEST THIS IS LINE 2 TEST THIS IS LINE 3
//SYSUT2 DD DSN=HLQ.DISTNEW.MAIL,DISP=(,CATLG), // SPACE=(TRK,5)
//SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY
//*-----------------------------------------------------------
//SENDMAIL EXEC PGM=IKJEFT01,DYNAMNBR=20 //SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=* //SYSEXEC DD DISP=SHR,DSN=SYS1.ISPCLIB //SYSTSIN
DD * SMTPNOTE SUBJECT(TESTMAIL) BATCH - TO(RECEIVER@MAIL.BLABLA.COM) -
DATASET('HLQ.DISTNEW.MAIL')
//*----------------------------------------------------------- //DELMAIL
EXEC PGM=IEFBR14 //DD1 DD DISP=(OLD,DELETE,DELETE),DSN=HLQ.DISTNEW.MAIL
You must have a SMTP server installed of course.
--
posted via MFF : http://www.MainFrameForum.com - USENET Gateway
| |
| Joe Zitzelberger 2004-09-15, 3:55 am |
| In article <1095151003.oRbv2jKJ10W16W4wC5AycA@onlynews>,
Old Mainframer <member@mainframeforum.com> wrote:
> Does anyone know of how to send an email (to multiple recipients) from
> within a mainframe program ? Does it have to be written to a file for
> JCL to send or can it be done directly ? Either way, examples of code
> welcomed !
>
>
>
> --
> posted via MFF : http://www.MainFrameForum.com - USENET Gateway
Depends. From a batch job, the simplest way is to write to the started
SMTP task. If your SMTP task is named SMTPXYZ, they you would code in
your JCL:
//MAILMSG DD SYSOUT=(B,SMTPXYZ)
The sysout class must be the one configured for your SMTP task, and the
writer name must me the started task name. Other than that, just format
it like any mail message. E.g.
HELO SMTPXYZ
RCPT TO soandso@wherever.com
FROM you@yourplace.com
SUBJECT Test
Test
| |
| Joe Zitzelberger 2004-09-18, 8:55 am |
| In article <1095151003.oRbv2jKJ10W16W4wC5AycA@onlynews>,
Old Mainframer <member@mainframeforum.com> wrote:
> Does anyone know of how to send an email (to multiple recipients) from
> within a mainframe program ? Does it have to be written to a file for
> JCL to send or can it be done directly ? Either way, examples of code
> welcomed !
>
>
>
> --
> posted via MFF : http://www.MainFrameForum.com - USENET Gateway
Depends. From a batch job, the simplest way is to write to the started
SMTP task. If your SMTP task is named SMTPXYZ, they you would code in
your JCL:
//MAILMSG DD SYSOUT=(B,SMTPXYZ)
The sysout class must be the one configured for your SMTP task, and the
writer name must me the started task name. Other than that, just format
it like any mail message. E.g.
HELO SMTPXYZ
RCPT TO soandso@wherever.com
FROM you@yourplace.com
SUBJECT Test
Test
|
|
|
|
|