Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using rexx to send an email

419 views
Skip to first unread message

jerry chapman

unread,
May 6, 2007, 7:08:29 PM5/6/07
to
I am updating an Excel spread sheet with oorexx. Under certain condition I
would like to email the spread sheet to someone as an attachment. Is there a
way I could do that?


Lee Peedin

unread,
May 6, 2007, 9:01:28 PM5/6/07
to

Jerry,
In the past I would have recommended ActiveX/OLE automation of MS
Outlook to send emails, but MS put some security "features" in Outlook
that require user intervention when sending emails. I've never tried
it, but many recommend using Outlook Redemption
<http://www.dimastr.com/redemption/>

At Safe Data, we send hundreds of emails daily. In fact we send so
many emails to our clients that we have been "blacklisted" on some
mail servers. Their reasoning - anyone that sends that many emails
must be spamming. We use a very nice open source product - Blat
<http://www.blat.net/> You might consider that as well.

Lee

Steve Swift

unread,
May 7, 2007, 3:46:02 AM5/7/07
to
> I am updating an Excel spread sheet with oorexx. Under certain condition I
> would like to email the spread sheet to someone as an attachment. Is there a
> way I could do that?

I have a subroutine which sends email. It uses RXSOCK but apart from
that it is "pure" Rexx.

It originated as part of the sample code that came with IBM Object REXX
(if its headers are to be believed) but I've worked on it a little, so
now claim my current incantation as mine. Perhaps you already have
something similar with your rexx?

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk

Shmuel (Seymour J.) Metz

unread,
May 6, 2007, 8:17:48 PM5/6/07
to
In <Ldt%h.896$SC4...@nlpi068.nbdc.sbc.com>, on 05/06/2007

Is there a mail command in windoze? If so, use it. If not, is
RXSockets available? You could write your own simple mail client (See
RFC 2821 and 2822).

--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spam...@library.lspace.org

Ken Leidner

unread,
May 7, 2007, 11:31:15 AM5/7/07
to
Not in REXX but in VBA (which rexx could call, something like this would do
the trick (I have used it in the past and tried to clean it up some to protect
the ...)

Sub email(file)
FolderPath = "\\usentus05\me$\Again\Top20\"
Emailaddress = "Top20People" ' ;oth...@company.com"
Set myOlApp = CreateObject("Outlook.Application")

Set EmailMessage = myOlApp.CreateItem(olmailitem)
With EmailMessage
.To = Emailaddress
' .Bcc = "y...@company.com" or what ever
.Subject = "Top 20 auto send " & file
.body = "Here is the Top 20 for the month" & Chr(10)
.Attachments.Add FolderPath & file
.Save 'this is to keep the code out of trouble
.Send
End With
End Sub

In article <Ldt%h.896$SC4...@nlpi068.nbdc.sbc.com>, jerr...@sbcglobal.net
says...

Lee Peedin

unread,
May 7, 2007, 11:56:33 AM5/7/07
to

Ken,
It's been a while since I did any Outlook automation, but the VBA code
you show could easily be translated into ooRexx; however, since the
2003 version of Outlook, this will not provide true automation in that
the user will have to confirm any sending of email through Outlook -
thus my comment on Outlook Redemption.

Lee

Sahananda

unread,
May 7, 2007, 12:25:31 PM5/7/07
to
I agree with Lee that the easiest way is probably to use Blat which is
small, free, well proven and reliable.

If however you want a pure ooRexx alternative then there is David
Ashley's orxUtils (available in Beta from the ooRexx download site on
Sourceforge http://sourceforge.net/project/showfiles.php?group_id=119701)
which contains an impressive looking SMTP class. He gives an example
(testsmtp.rex) which clearly shows how to build and send a mime
message in a mere 11 Rexx clauses.

Jon

Shmuel (Seymour J.) Metz

unread,
May 7, 2007, 11:06:54 AM5/7/07
to
In <i9us33lubh43i9o8b...@4ax.com>, on 05/07/2007

at 01:01 AM, Lee Peedin <lpeedinD...@nc.rr.com> said:

>At Safe Data, we send hundreds of emails daily. In fact we send so
>many emails to our clients that we have been "blacklisted" on some
>mail servers. Their reasoning - anyone that sends that many emails
>must be spamming.

How do you know that? It's more likely that you were inadvertently
spamming and need to examine your list management and your security.

Lee Peedin

unread,
May 7, 2007, 2:41:37 PM5/7/07
to
On Mon, 07 May 2007 12:06:54 -0300, "Shmuel (Seymour J.) Metz"
<spam...@library.lspace.org.invalid> wrote:

>In <i9us33lubh43i9o8b...@4ax.com>, on 05/07/2007
> at 01:01 AM, Lee Peedin <lpeedinD...@nc.rr.com> said:
>
>>At Safe Data, we send hundreds of emails daily. In fact we send so
>>many emails to our clients that we have been "blacklisted" on some
>>mail servers. Their reasoning - anyone that sends that many emails
>>must be spamming.
>
>How do you know that? It's more likely that you were inadvertently
>spamming and need to examine your list management and your security.

That might be the case, but I seriously doubt it. For a while all
emails I sent to my wife's email account at the college where she
works was rejected. According to "their IT department", the
blacklisting was due to the volumn of emails we send - not the
content. Anyway, we seem to have "cleared" our name from all lists we
were made aware of. :-)

Lee

Anne & Lynn Wheeler

unread,
May 7, 2007, 2:54:11 PM5/7/07
to

from long ago and far away ... REXX exec used for generating tcp/ip
email (actually it took existing email in numerous formats and coverted
them to 822 format)

the sending of attachments normally involves mime support.


********************** XXXX Internal Use Only ************************
* :nick.REMAIL
* :sec.XXXX Internal Use Only
* :title.REMAIL - trivial exec for VM/822 mail forwarding
* :version.1
* :date.87/09/28
* :scp.VM/SP.3 ONWARDS
* :oname.Lynn Wheeler
* :onode.
* :ouser.WHEELER
* :aname.Lynn Wheeler
* :anode.
* :auser.WHEELER
* :lang.REXX
* :abs.REMAIL will process all spooled reader mail, convert it to
* 822 mail format and forward it to the specified TCP/SMTP mail
* gateway for sending to the specified tcp/ip node. If the VM/TCP/IP
* SMTP mail gateway is installed, REMAIL can be used to forward
* all VM mail to your <unix workstation>.
* :kwd.MAIL TCP/IP SMTP 822
* :sw.
* :doc.REMAIL MEMO
* :support.N
********************************************************************* **
*
&1 &2 REMAIL EXEC * Process spool reader files
&1 &2 REMAIL XEDIT * Reformat cms mail to 822 format
*
&1 &2 DISCRDR EXEC * Toy exec that activates REMAIL
&1 &2 XROSSCAL EXEC * Toy exec for generating PROFS cal. req.
* *
&1 &2 REMAIL MEMO * Brief documentation

Shmuel (Seymour J.) Metz

unread,
May 8, 2007, 8:30:45 AM5/8/07
to
In <2jsu3393p1canoeha...@4ax.com>, on 05/07/2007

at 06:41 PM, Lee Peedin <lpeedinD...@nc.rr.com> said:

> According to "their IT department", the blacklisting was due to the
>volumn of emails we send - not the content.

Spam isn't about content; it's about consent. If you were sending a
high volume of e-mail to people that requested it then it wasn't spam,
even if it was about erection drugs, pornography, pyramid schemes and
stock tips. It might, of course, violated their AUP/TOS, but that's a
separate issue.

Shmuel (Seymour J.) Metz

unread,
May 8, 2007, 8:27:01 AM5/8/07
to
In <m37irkl...@garlic.com>, on 05/07/2007

at 12:54 PM, Anne & Lynn Wheeler <ly...@garlic.com> said:

>from long ago and far away ... REXX exec

The code you show is not REXX, it's EXEC.

Reminds me of the difference between ERASE CMS EXEC and EXEC CMS
ERASE.

Anne & Lynn Wheeler

unread,
May 8, 2007, 10:48:45 AM5/8/07
to
"Shmuel (Seymour J.) Metz" <spam...@library.lspace.org.invalid> writes:
> The code you show is not REXX, it's EXEC.
>
> Reminds me of the difference between ERASE CMS EXEC and EXEC CMS
> ERASE.

it isn't code ... it is a "package" file description ... used by
toolsrun (also implemented in rexx) ... somewhat analogous to README
file.

toolsrun provided all sorts of function ... it had listserv type
function for email distribution lists ... for conferencing and file
distribution (like application packages). it also had support for
repositories ... where local "slave" toolsrun could maintain the same
kind of information that might be distributed via email, sort of being
able to operate either in listserv mode and/or more similar to early
usenet.

by the way, it predated listserv that evolved for bitnet ... some old
posts
http://www.garlic.com/~lynn/subnetwork.html#bitnet

in the late 70s and early 80s ... I had been doing some semi-automated
computer conferencing type stuff on the internal network. at some point
top executives became aware of the situation ... and there was an
"investigation" ... one of the outcomes was decision to have some
official corporate supported computer conferencing facilities ... which
then contributed to the wide-spread deployment of toolsrun.

there was also a researcher hired to sit in the back of my office and
follow me around for nine months ... investigating how i communicated
(face-to-face, telephone, etc ... they also had copies of my incoming
and outgoing email as well as all of my instant messages). The resulting
research report was also a Stanford PHD thesis (joint between language
and AI depts) ... and the material for subsequent books and papers.
somewhat related posts
http://www.garlic.com/~lynn/subnetwork.html#cmc

David Ashley

unread,
May 8, 2007, 11:40:01 AM5/8/07
to

The sending of attachments involves supporting mime when it come to SMTP
mail. This is not for the faint of heart, it is complicated and prone to
error by the casual programmer.

Having said that, If you really want to use mime and SMTP you should
look at the OrxUtils package available on the ooRexx SouceForge download
page. It contains, amoung a lot of other things, a full implementation
of mime and SMTP. It has some basic examples included that can guide
you. With this package you can create any kind of email you can think of.

W. David Ashley
Open Object Rexx Team

Phil Hobbs

unread,
May 8, 2007, 11:15:12 PM5/8/07
to
Anne & Lynn Wheeler wrote:
> "Shmuel (Seymour J.) Metz" <spam...@library.lspace.org.invalid> writes:
>> The code you show is not REXX, it's EXEC.
>>
>> Reminds me of the difference between ERASE CMS EXEC and EXEC CMS
>> ERASE.
>
> it isn't code ... it is a "package" file description ... used by
> toolsrun (also implemented in rexx) ... somewhat analogous to README
> file.
>
> toolsrun provided all sorts of function ... it had listserv type
> function for email distribution lists ... for conferencing and file
> distribution (like application packages). it also had support for
> repositories ... where local "slave" toolsrun could maintain the same
> kind of information that might be distributed via email, sort of being
> able to operate either in listserv mode and/or more similar to early
> usenet.
>

I remember TOOLSRUN very fondly. All the IBM internal forums used to
use it, as well as the internal tool distribution discs. I wish I had a
newsreader with the comfort features of FORAVIEW!

Cheers,

Phil Hobbs

Anne & Lynn Wheeler

unread,
May 9, 2007, 9:43:23 PM5/9/07
to

Phil Hobbs <pc...@SpamMeSenseless.pergamos.net> writes:
> I remember TOOLSRUN very fondly. All the IBM internal forums used to
> use it, as well as the internal tool distribution discs. I wish I had
> a newsreader with the comfort features of FORAVIEW!

re:
http://www.garlic.com/~lynn/2007j.html#50 Using rexx to send an email
http://www.garlic.com/~lynn/2007j.html#54 Using rexx to send an email

from long ago and far away, other TOOLSRUN folklore, old email regarding
enhanced RSCS drivers for HSDT (t1 & higher speed) links & conflict with
TOOLSRUN.

From: wheeler
Date: 11/25/86 14:44:06
To: distribution
re: hsdt link;

the only conflict that I'm aware of with HSDT RSCS drivers are a
current conflict with the TOOLSRUN exec (the REXX exec from <<rexx
author>> that handles all the tools disks). The REXX exec expects that
for files that originated from VM nodes, the second NOP/TAG record (i.e.
RSCS control information) alwas contained the origin nodeid & userid. If
that is not found in the 2nd record, TOOLSRUN rejects the file.

As part of improving the efficiency of HSDT links, the RSCS line driver
code to do character compression was removed (it was determined that the
cpu overhead was costing much more than the transmission time savings
... i.e. actually ran slower). With that change, "S&F" records began
appearing as the 2nd nop/tag record.

After a bit of analysis, it turns out that S&F records were RSCS
information records that alwas were part of the file, but somewhere in
the far distant past a change to the compression code inadvertantly also
deleted forwarding of S&F records. With the deletion of the compression
code, the S&F records magically reappeared.

There is a simple 3 line change to the TOOLSRUN EXEC to recognize S&F
records and bypass them when looking for the origin information
record. There is a separate 40-60 line change to the TOOLSRUN exec which
generalizes the processing of the nop control information, which
recognizes a large number of different formats based on content (rather
than position). This more complex change also correctly handles
recognition of origin information from MVS/JES systems.

There is currently discussion about how best to resolve the TOOLSRUN
EXEC problem. The removal of the compression code makes sense in a
number of situations ... not just for HSDT links but for other links
where the speed may be as slow as 56kb (i.e. CPU compression overhead
taking more time than the transmission savings of transmitting
uncompressed record).

... snip ...

for other topic drift, old email referencing DATASTAG EXEC, a
pre-TOOLSRUN facility that provided ftp/anonymous type function
http://www.garlic.com/~lynn/2006v.html#email800409
http://www.garlic.com/~lynn/2007b.html#email821214
http://www.garlic.com/~lynn/2007b.html#email821217

lots of posts related to HSDT (high-speed data transport) project
http://www.garlic.com/~lynn/subnetwork.html#hsdt

and for other topic drift, past posts related to the internal network
http://www.garlic.com/~lynn/subnetwork.html#internalnet

and for even more topic drift ... old email dealing with various
aspects of HSDT dealing with events surrounding the NSFNET backbone
http://www.garlic.com/~lynn/lhwemail.html#nsfnet

i.e. while tcp/ip is the technology basis for the modern internet, we
claim that hte NSFNET backbone was the operational basis for the
modern internet.

in related hsdt activity, the mainframe tcp/ip product had been
implemented in vs/pascal. it had several thruput issues; it could
consume a full 3090 processor while only getting 44kbytes/sec
aggregate thruput. I made the modifications to the product to support
RFC1044 and in some testing at Cray research between a Cray machine
and a 4341-clone, was sustaining 4341 hardware interface speed
(1mbyte/sec) using only a modest amount of the 4341-clone processor
(over 20 times the aggregate data rate for less than 1/20th the
processor overhead). past posts mentioning doing rfc 1044 support:
http://www.garlic.com/~lynn/subnetwork.html#1044

some recent posts mentioning mainframe tcp/ip support and
vs/pascal
http://www.garlic.com/~lynn/2007b.html#12 Special characters in passwords was Re: RACF - Password rules
http://www.garlic.com/~lynn/2007c.html#29 Being "Open" (Was: Mainframe vs. "Server")
http://www.garlic.com/~lynn/2007h.html#8 whiny question: Why won't z/OS support the HMC 3270 emulator
http://www.garlic.com/~lynn/2007h.html#41 Fast and Safe C Strings: User friendly C macros to Declare and use C Strings
http://www.garlic.com/~lynn/2007h.html#60 Fast and Safe C Strings: User friendly C macros to Declare and use C Strings

ganeshf...@gmail.com

unread,
May 13, 2007, 3:04:50 AM5/13/07
to
On May 7, 6:01 am, Lee Peedin <lpeedinDONOTSP...@nc.rr.com> wrote:
> On Sun, 6 May 2007 16:08:29 -0700, "jerry chapman"
>

Hi,
I need to create a Report in an excel format using rexx and the report
has to be mailed .can u say whether its possible or not if possible
please help me in this.

Lee Peedin

unread,
May 13, 2007, 7:40:55 AM5/13/07
to


It is very possible - infact that is just one of the many ways we send
data to our clients. Wander over to
http://pragmaticlee.safedataisp.net for lots of examples on how to use
ooRexx to create and read Excel workbooks. If you run into something
specific that you can't handle, feel free to contact me directly.
Remove the DONOSPAMME from my email address.

Lee

0 new messages