Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageWe 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
Post Follow-up to this messageIn 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
Post Follow-up to this messageIn 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
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.