
SMTP Gateway
If you have any questions about the content of this page, please contact Requests for clarification
SMTP Gateway provides the capability to send items from CICS or a batch job directly to Internet-type e-mail addresses.
NWRDC provides a linkable subprogram, NWTOSMTP that will invoke SMTP from a customer CICS program.
Here is a sample batch jobstream:
//GENER EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD DUMMY
//SYSUT2 DD DISP=(NEW,PASS),DSN=NW.LSB.MAIL3.MCTEMP,
// UNIT=SYSDA,DSORG=PS,LRECL=80,RECFM=FB,
// DATACLAS=DCTINY
//SYSUT1 DD *
THIS NOTE WILL BE DELIVERED TO LEE BURGESS
e-MAIL IN-BASKET USING THE TCP/IP SMTP GATEWAY.
//TSO EXEC IKJBATCH
//SYSTSIN DD *
SMTPNOTE BATCH DATASET('NW.LSB.MAIL3.MCTEMP') -
SUBJECT(TEST SMTP GATEWAY) -
TO(host@domain.com)
The SMTP Gateway requires the registration of any batch job logonid that invokes the service. Mail from unregistered logonids are rejected. Contact NWRDC customer support for authorization. Contact Requests for assistance.
NOTE: One-half megabyte is the MAXIMUM SIZE of items processed by SMTP.
SMTP Batch Mail Error Notification
Several institutions have incorporated SMTP batch mail into their application processing to deliver notifications of one type or another to internet mail addresses.
Occasionally, there are problems with the address of the intended recipient. In that event, SMTP generates an error notification destined for the logon ID of the batch job from which the note was sent.
Since the entire SMTP process is asynchronous, there is no way for the original batch job to determine if the message was sent correctly.
The only way to retrieve these error notifications is to subsequently issue a TSO RECEIVE command.
While this can be done manually online, it can also be done in a batch job. Example:
//NWLSBSMP JOB (NWLSB,,,9),'SMTP TEST'
//*---------------------------------------------
//* WILL PLACE SMTP ERROR NOTIFICATIONS
//* IN DATASET NW.LSB.ERRMSG.FROMSMTP
//*---------------------------------------------
//TSO EXEC IKJBATCH
//SYSTSPRT DD DUMMY
//SYSTSIN DD *
RECEIVE LOGDSNAME(ERRMSG.FROMSMTP)
The SMTP error notifications queued for logon ID NXLSB will be placed in dataset NW.LSB.ERRMSG.FROMSMTP by this job.
If the dataset doesn't exist, it will be dynamically allocated. If it already exists, data will be appended to the end of the current file.
The SMTP error notifications are sysouts associated with the SMTP started task with a destination of NWR.logonid.
As such, they remain available for a period of 10 days. Errors can thus be received at any time within that 10-day window.
For example, a job could be scheduled to run weekly to receive all such errors.
Once received, the sysout is purged, so it will not be received again if the job is run again.