I use the following code Rexx code to send emails. It may be specific to my
site and my not work for you. If it does then go for it.
"EXECIO" mrec "DISKW EMAILFIL (STEM mail. FINIS)"
Address TSO "XMIT BLDVMB.VNETIBM DDNAME(EMAILFIL)
NOEPILOG NOLOG NOPROLOG"
"FREE FILE(EMAILFIL)"
"DELETE ('"email_dsn"') PURGE"
Thanks,
Ray Baraniecki
Morgan Stanley Smith Barney
18th Floor
1 New York Plaza
New York, NY 10004
Office - 212-276-5641
Cell - 917-597-5692
[email protected]
BE CARBON CONSCIOUS. PLEASE CONSIDER OUR ENVIRONMENT BEFORE PRINTING THIS
E-MAIL.
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of
Joel C. Ewing
Sent: Wednesday, July 29, 2009 9:08 AM
To: [email protected]
Subject: Re: Sending email via rexx
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
--------------------------------------------------------------------------
Important Notice to Recipients:
It is important that you do not use e-mail to request, authorize or effect the
purchase or sale of any security or commodity, to send fund transfer
instructions, or to effect any other transactions. Any such request, orders, or
instructions that you send will not be accepted and will not be processed by
Morgan Stanley Smith Barney.
The Global Wealth Management Group of Morgan Stanley & Co. Incorporated and the
Smith Barney division of Citigroup Global Markets Inc. have combined into
Morgan Stanley Smith Barney LLC, a new investment adviser and broker-dealer
registered with the Securities and Exchange Commission. The sender of this
email is an employee of Morgan Stanley Smith Barney.
Important disclosures on Morgan Stanley and Citi Investment Research & Analysis
research reports may relate in part to the separate businesses of Citigroup
Global Markets Inc. and Morgan Stanley that now form Morgan Stanley Smith
Barney LLC. To view these important research disclosures, go to
http://www.morganstanley.com/researchdisclosures and
https://www.citigroupgeo.com/geopublic/Disclosures/index_a.html.
If received in error, please destroy and notify sender. Sender does not intend
to waive confidentiality or privilege. Use of this email is prohibited when
received in error. We may monitor and store emails to the extent permitted by
applicable law.
----------------------------------------------------------------------
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