Mark Zelden wrote:
On Tue, 28 Jul 2009 13:19:57 -0500, gsg <[email protected]> wrote:

Does anyone know how to send a email via a rexx routine?  Also, are there
any good LISTSERV specifically for rexx?

TIA


To start with the 2nd question: TSO-REXX. Subscribe at [email protected]

IBM's SMTPNOTE sample is in REXX.  It lives in hlq.SEZAINST(SMTPNOTE)  .

XMITIP is probably REXX, isn't it?

For a very simple sample, how about this:

/* REXX */ parse arg recpt msg smtp.1 = 'HELO' MVSVAR('SYSNAME') smtp.2 = 'MAIL FROM:<[email protected]>' smtp.3 = 'RCPT TO:<'recpt'>' smtp.4 = 'DATA' smtp.5 = 'FROM:"Mark Zelden" <[email protected]>' smtp.6 = 'TO:' recpt smtp.7 = 'Subject: SMTPREXX Email Message' smtp.8 = msg /* smtp.9 = 'QUIT' */ "ALLOC F(SMTPOUT) SYSOUT(B) WRITER(SMTP)" if RC <> 0 then do say 'Error allocating SYSOUT for SMTP WRITER' exit 12 end "EXECIO * DISKW SMTPOUT (STEM SMTP. FINIS" if RC <> 0 then do say 'Error writing SYSOUT for SMTP WRITER' "FREE F(SMTPOUT)" Exit 12 End "FREE F(SMTPOUT)"

Calling the exec and passing parms left as an exercise to the reader.

Mark
--
Mark Zelden
Sr. Software and Systems Architect - z/OS Team Lead
Zurich North America / Farmers Insurance Group - ZFUS G-ITO
...
A large part of XMITIP is written in REXX (some features like pdf generation, etc. call assembler-based code under the covers). This means you can simply "CALL XMITIP" from another REXX program with the same parameters (and optional file allocations) as you would in batch XMITIP invocations. There is also an ISPF dialog interface to XMITIP, but we rarely use it. XMITIP is a freebie available via http://www.lbdsoftware.com/tcpip.html and is well documented.

XMITIP, like the simple sample below, produces SYSOUT to the JES queues, and both presume you have the JES-based SMTP server configured and running to pull and process that SYSOUT. Whether the SYSOUT class is "B" or some other class depends on how that server is configured (we use a numeric class "3" to keep Email clutter away from the classes Operators care about). The simplest SMTP server set up is to have it forward email to a corporate email server on another platform. That relegates any firewall and undeliverable email issues to the corporate email server, where they have presumably already been solved.

For simple Email, the direct generation of the Email SYSOUT can be done as in Mark's example, but if you want to do anything at all fancy I would recommend using XMITIP and letting it deal with all the petty syntax and semantics details. XMITIP does at least require a TSO environment (batch or interactive), so there may be some places (like Netview automation) where it can't be used.

Usage of these techniques for any mass corporate emailing needs to be approached with care to avoid exhausting your JES resources and causing serious problems. For the few batch processes we have that do this, we have written a REXX front end to XMITIP which will process a batch of messages from a file, but come up for air every several hundred messages and use the SDSF API to verify there is no shortage of JES resources before allowing the process to continue.
  J C Ewing

--
Joel C. Ewing, Fort Smith, AR        [email protected]

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to