HP3000-L Archives

April 1998, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Chris Bartram <[log in to unmask]>
Reply To:
Date:
Fri, 3 Apr 1998 18:57:29 -0500
Content-Type:
Text/Plain
Parts/Attachments:
Text/Plain (102 lines)
I don't normally post this kinda stuff, but we have alot of customers
e-mailing reports (usually spoolfiles) from the 3000 to pc clients. More
often than not, pc clients like to view these files with proportional fonts,
which wreaks havoc on (what was) neatly lined up columns of data.

One of our customers came up with the notion of tagging the report as an
html document and prepending the appropriate tags to force the pc to view
the data in a non-proportional font. I thought this was rather clever, and
turns out to work well. I'm attaching a short command file that illustrates
how to do this in NetMail, and I suspect it can be modified to use other
mail transports at some level.

One trick; NetMail determines MPE file types by looking at (among other
things) the MPE filecode, and we keep a (user-modifiable) table of all the
common filecodes (per Stan Sieler's master list) used on the 3000. In that
vein, HTML files are filecode 2133, so this command file copies the spool
file into a new file with filecode 2133, then sends that file. The resulting
message gets sent as a TEXT/HTML (MIME labelled) message, that's still
perfectly viewable from plain text mail clients/terminals. Anyway, hope this
helps someone else...

Explanation of parms/sample usage after the script:

----------------------------------cut here---------------------------------
PARM recip_addr,mailbox='',mailpass='',spid,subj='Message Subject'
comment
comment This command file sends the spoolfile identified by 'spid' as an
comment *html* file to the mailbox 'recip_addr'.
comment The mailbox used to send the message (from) is identified by the
comment 'mailbox' variable, and that mailbox' password by 'mailpass'
comment
comment Example usage:
comment (assuming this file is called 'sendhtml.xeq')
comment :XEQ sendhtml.xeq [log in to unmask],admin,Apass,6702,'Quarterly Report'
comment
setvar netmail_mailbox '!mailbox'
setvar netmail_mailbox_pwd '!mailpass'
setjcw netmailsigprompt=2
continue
setvar sprecs finfo("o!spid.out.hpspool",19)+10
continue
purge report,temp > $null
build report;temp;rec=-132,,f,ascii;disc=!sprecs;code=2133
file r=report,oldtemp;acc=append
file htmlrep=report,oldtemp
echo !<html!>!<body!>!<pre!> >> report
comment
comment we print the spoolfile, starting at record #3 to get past the
comment initial CCTL codes at the beginning of the spool file
comment
print o!spid.out.hpspool;start=3;page=0;out=*r
CONTINUE
PURGE tmpx,temp > $NULL
ECHO SEND *htmlrep >> tmpx
ECHO  >> tmpx
ECHO !subj >> tmpx
ECHO !recip_addr >> tmpx
ECHO // >> tmpx
ECHO EXIT >> tmpx
RUN NETMAIL.SYS.THREEK,BATCH;STDIN=TMPX;STDLIST=$NULL
PURGE TMPX,TEMP
comment
comment if this message was sent successfully, then the jcw
comment CMCM1T1 = 1
comment    M1 designates 1st message for this execution
comment      T1 designates 1st To: recipient for this message
comment '1' = successful; anything else indicates a problem with this
comment       recipient
comment
deletevar netmail_mailbox
deletevar netmail_mailbox_pwd
purge report,temp
reset r
reset htmlrep
if cmcto>0 then
  echo Message Successfully sent to !cmcto recipients
else
  echo Invalid recipient address(es)
endif
----------------------------------cut here---------------------------------

  The command file is invoked like this:

:sendhtml.xeq [log in to unmask],rcb,,22700,"Quarterly Sales Report"

The first parameter is the recipient address (or it can be a list of
addresses in quotes separated by commas). The second parm specifies the
mailbox to use in sending the message (who it comes FROM), the third is
the mailbox' password (if used). The next parm is the Spoolfile #, and the
final parm is the subject of the message.

Picking the appropriate spoolfile is left as an excercise for the reader. ;-)

When the command file is invoked, it sets JCWs indicating how many success-
ful recipients were processed, and reports on it like:

Message Successfully sent to 1 recipients

Any questions, remove the "nospam" from my address to reply to me.

                 -Chris Bartram

ATOM RSS1 RSS2