ͫFM6/ 6- MuD@LLLfootnote continues next pagecontinued footnoteHP LaserJet IIIP H:xbd 376% sendemail config Enable version94David Bindoff adapted from F McCloskey's Enablemail bd8(:5 -_LRrJj+TNX^ZzC.:;^|\/()<>[]{}IA1ai023456789  4 ,   // ::%V*L -T -T -T -T -T -T -T -T'-+v-R'wp ` p  %@8p(HHeader and Page Break tOFThe ENMAILT4.FW program is an EnableOA procedural language program which IFprovides a facility within the Enable environment to prepare and send an?Femail message using the SENDEMAIL-1.54-config by Brandon Zehm FFLFENMAILT4.FW can be run as a report form in Enable's normal database system.MFIt can be run against any database as it assumes control of its own windows,GFmakes no changes to the source database, only updating its own addressLFdatabase (currently M.DBF) and sent messages database ( currently MS.DBF). NFFor safety it is 'recommended' that it be run against a null record database For WINDOW N.N FUFENMAILT4.FW writes to disk two text files currently named 0n.c, for the config PFfile which informs SENDEMAIL the address, attachment, file names and settingsSFdetails and also 0o.a, which is the message file.These text files are currentlyOFprogrammed to write to the \windows\temp directory. The SENDEMAIL program willIFneed to be copied into the same directory and two DLL files may also be \Frequired,0LIBEAY32.0DLL and 0SSLEAY32.0DLL. SENDEMAIL is available for downloadLFfrom w.thogscave.org/enable and provides its own help at the command lineFby sendemail --helpF"FThe fields referred to in MS are;FMSMA= memo fieldFMSSUB= subject text field 55FMSDATE = date field 10FMSTIME = time field 8FMSAD= recipient adress55FMSCC= cc address 55BMSSENDER= sender 550FMSAT= text field for attachment reference 55B!FThe fields referred to in M are;FAD= TEXT 55 INDEXEDFAWTI= TEXT 30FFI= TEXT 15FSU= TEXT 20FLFThese databases will need to be defined prior to use (and names changed if FFthere is a conflict, and references in ENMAILT4.FW modified also)BKFMy preferred way to run ENMAILT4.FW is via a macro from any and all EnableKFword processing files, the macro is posted below and assumes you are in a JFword processing file which is nearly ready for sending, perhaps requiringIBEnable's comments to be removed before sending, the macro is referred toGFas alt/f9 e or ${E}.WPM; (line 10 refers to a null record database K) BB{^Home}B{Up}B{F3} Bh{F2}{Left}B{Wname}Bneword~B{If Error}B{EndIf}B{OpenW} Budpk{2X}~B{Wname}Bemail~Benmailt4.fw{End}. B{&F5}<B{GoToW}Bneword~B{If Error}B{EndIf}B{^Home}B{&F3}B{F7}B{^End} B{F2}{End}B{F7}B{^Home}B{&F5}B{^Home}B{Send}fF(s)first edit - extract text from comment, then remove comment~FJFIf ENMAILT4.FW is run this way, it is currently configured to sense, thenMFsave and close the word process window after sending, in addition to closingFits own windows.FQFENMAILT4.FW can also be run from a user defined menu very simply. As currentlyMFconfigured, ENMAILT4.FW returns automatically to a system menu called Y.mnu NFThe user will need to delete or modify the references to {^f10}y in the macroFcodes.BLFHaving set up the files, running ENMAILT4.FW simply consists of entering itLFas a report form and pressing the end key, you will be greeted with a smallJFmemo window into which text is added. If you came via the word processingKFmacro, the window will contain all the text from the word processing file.KFThis window is standard Enable memo and you use alt/end to close, if youNFsave, the text will be saved, otherwise it may be blank. The next prompt asksMFfor an attachment file reference, entirely optional, then the 0From: or LFsender's address prompt is entered. The 0From: prompt is not currentlyKFprogrammed with a drop down selection box so manual entry or hard-coded inRFthis program is needed. The next prompt is the 0TO: prompt for the recipients LFaddress. If you have not populated your M database type in '+' and you willOFbe prompted to enter a new email address to the database, then an associated PFname for the address, these entries will be added to the M database. If there MFare addresses in M you can hit enter or type in a character or two, then youLFare put into the selection box, you can use the proximity search to quicklyQFlocate the desired address from the list, it can be selected by mouse click or UFenter. The next prompt is the 0CC: it is optional, so typing enter at the blankKFprompt will be accepted as a blank entry, if you want a cc, add address byNF'+' or type in a character and enter the selection box as for 0To: prompt.CFThe next prompt is 0Subject: and can be blank also, or text 55.FKFThe addressing routine is very flexibly controlled by cursor keystrokes,QFenter, up, down, pgup, pgdown (all courtesy of F G McCloskey), only the 0To: MFfield demands an entry if left blank. Once the mandatory 0From: and 0To:OFfields are completed shift/f6 can launch the email at any time and ctrl/m willIFenter the message for re-editing. 'escape' will close the program and if6Fyou started from word processing will return there.FOFYou will need to ascertain your own ISP's server address, currently configuredNFas my own address. I expected it would not run with this header in place, butJFit does seem to run fine, so there is very little work to do to use this OFprogram. It is a simple functional program, very amenable to use in automation6Bprocedures and quite handy for simple file transfers.BLFENMAILT4.FW is adapted by me from the original Enablemail program provided GFby F G McCloskey, who liaised with Brandon Zehm to secure this versionBof Sendemail. @>k.report division ;;707101549 exec_dos and full config 0n.c sendemail=new config sendemail versionfor supplier emails and other WPF files+.define la as integer 1 ;; control lattach3.define lattach as text 55 ;; attachment file name'.define sys:date using "Month dd, y".define lput3 as integer 1.define weewin as memo.define puts[4] as text 55A.define lawti[4] as text 30;; associate titles from m database.define n as integer 1.define fldnum as integer 1.define fldcnt = 4.define f as text 30.define n as integer 2.define yn as logical.define whosmtp as text 30A.define smtp = "mail."&@trim(@lc(whosmtp)) ;; was smtp not mail;;.define send as text 240;;.define send = "sendemail -f "&@trim(puts[1])&" -t "&@trim(puts[2])&@if(puts[3]='$@$'," -cc "&@trim(puts[3]),"")&" -u "&@trim(puts[4])&' -o config=n.c'+;;.define send = 'sendemail -o config=n.c'a.intro ;; command line or .bat needs to be <=102 characters by the looks for exec_dos to handle .open ms &.let f="0youraddress@yourprovider" .maxscreen.reformat off .gosub fromR0;; from: address 0configured to different defaults for different network users#.IF @ID(1,2)='E6' OR @ID(1,2)='D6'E.let puts[1] = "0youraddress@yourprovider" ;; *@netspace.net.au#.let lawti[1]= "0Your Title "7.elseif @ID(1,2)='E1' OR @ID(1,2)='D1'OR @ID(1,2)='D7' .let puts[1] = "*@ *.com.au".let Lawti[1]= " *"'.elseif @ID(1,2)='E2' OR @ID(1,2)='D2'%.let puts[1] = "accounts@ *.com.au"'.let Lawti[1]= "Accounts at * *" '.elseif @ID(1,2)='E3' OR @ID(1,2)='D3' .let puts[1] = "*@ *.com.au".let Lawti[1]= "* *"'.elseif @ID(1,2)='E3' OR @ID(1,2)='D3'&.let puts[1] = "warehouse@ *.com.au"&.let Lawti[1]= "Warehouse at * *").else;;if @ID(1,2)='E1' OR @ID(1,2)='D1'%.let puts[1] = " *@netspace.net.au".let Lawti[1]= "* * ".endif.let puts[3] = "".let puts[4] = "" .let yn=1A  .macro {F9}wls{6x}{Down}{Up}{9x}{Right}{3x}{Left}{Esc}{Home} .input weewin.label newstart .clrscreen.gosub sdesign.let fldnum = 1.while fldnum <=5 .escape off%.input (fldnum+1,12,55) puts[fldnum].if sys:lchar=283 .escape onl.macro {esc}{&end}{gotow}neword~{send}(s)escaped from email address alt/f9 e (or menu) to startagain~ .input .endif  .if fldnum=2  .read m index m.ad=puts[2]7 .if (puts[2]=' ' or m.sys:record=0) and puts[2]<>'+'  .escape off> .begin popup "",6,1,20,78,"ĿĴ",m,m.ad,puts[2],U ",,,0,0,"email address: ", ,"r","",m.ad{30},m.awti{20},m.mfi{15},m.msu{15};7.if SYS:LCHAR = 7181;; Scan code for Enter key.let puts[2]=m.ad .LET lawti[2]=m.awti.elseif sys:lchar=283 .escape onl.macro {esc}{&end}{gotow}neword~{send}(s)escaped from email address alt/f9 e (or menu) to startagain~ .input .endif  .escape on$ .macro {Voff}{&Home}{Esc}{Von} .screenpos(3,12) [m.ad ]  .elseif puts[2]='+'$  .input 'new email address 'm.ad/  .input 'new name for email address 'm.awti  .write m  .let puts[2]=m.ad  .let lawti[2]=m.awti .screenpos(3,12) [m.ad ]  .endif  .elseif fldnum=3  .read m index m.ad=puts[3]9  .if puts[3]<>' ' and m.sys:record=0 and puts[3]<>'+'  .escape off> .begin popup "",6,1,20,78,"ĿĴ",m,m.ad,puts[3],V ",,,0,0,"email address: ",,"r","",m.ad{30},m.awti{20},m.mfi{15},m.msu{15};7.if SYS:LCHAR = 7181;; Scan code for Enter key.let puts[3]=m.ad .LET lawti[3]=m.awti.elseif sys:lchar=283 .escape onl.macro {esc}{&end}{gotow}neword~{send}(s)escaped from email address alt/f9 e (or menu) to startagain~ .input .endif  .escape on$ .macro {Voff}{&Home}{Esc}{Von} .screenpos(4,12) [m.ad ]  .elseif puts[3]='+'$  .input 'new email address 'm.ad/  .input 'new name for email address 'm.awti  .write m  .let puts[3]=m.ad  .let lawti[3]=m.awti .screenpos(4,12) [m.ad ]  .endif .endif.gosub sdesign.gosub keytest .endwhile.output screen off .reformat on.output screen on .reformat on.reformat off.clrscreen (9,5,19,59).screenpos (1,1)  @ͻ  From: [puts[1].]   To:[puts[2].]   cc:[puts[3].]  subj: [puts[4].]  @  @  @R   0Control/M - Open Message Window - second edit 0alt/end to exitB  Then run through addresses and subject again   0   T** TOr **)  @L  0Shift/f6  to 0send message as is - returns to * MENUN   if you came from a wordprocessing file it is saved and closed  =    (send with shift/f6 whenever ready )  @   *  @  @  @  @ͼ .let yn=yes.goto newstart.label newout.output screen off .REFORMAT ON) .output ASCII on c:\windows\temp\n.c-f [puts[1]]-t [puts[2]].if @match(puts[3],"@") <> 0-cc [puts[3]].endif.if lattach<>' '-a [lattach].endif-u [puts[4]]-omessage-file=O.A-smail.netspace.net.au, .output ASCII close C:\WINDOWS\temp\n.c.REFORMAT OFF%.output ASCII on c:\windows\temp\O.A>from: [lawti[1]] to: [lawti[2]] [sys:date] [sys:time].if puts[3]<>' ' cc : [lawti[3]](.else.endifSubject: [puts[4]8] [weewin](.output ASCII close c:\windows\temp\O.A2.exec_dos c:\windows\temp\sendemail -o config=n.c.mconcat ("",weewin,msma) .let mssub=puts[4].let msdate=sys:date.let mstime=sys:time.let msad=puts[2].let mscc=puts[3].let mssender=puts[1].let msat=lattach.add ms  .escape onr  .macro {gotow}neword~{IF ERROR}{else}{&end}{ifbox}y{endif}{endif}{GOTOW}email~{gotow}email~{esc}{&end}{^f10}y  .input .elseo.macro {esc}{&end}{gotow}neword~{down}{&f7}{send}(s) email send aborted start again with alt/f9 e (or menu)~.input.endif.exit .subroutines .label FROM .clrscreen..let whosmtp = @substr(f,@match(f,"@")+1,22).return.label sdesign.screenpos (1,1)  @ͻ  From: [puts[1].]   To:[puts[2].]   cc:[puts[3].]  subj: [puts[4].]  @  @  @P  0Control/M - Open Message Window - second edit 0alt/end to exit@  Then run through addresses and subject again  0   T** TOr **)  @L  0Shift/f6  to 0send message as is - returns to * MENUL  if you came from a wordprocessing file it is saved and closed  ;   (send with shift/f6 whenever ready )  @  *  @  @  @  @ͼ .if puts[2]=' ' and la=0.screenpos(18,7)90Enter Attachment path and filename 0below (if needed).input(19,7 )'0'lattach .let la=1.endif.if lattach<>' '.screenpos(18,7)40 Attachment path and filename 0shown below 0[lattach-].else.screenpos(18,7)0 )0 <.endif.return.label keytest .do case&  .case sys:lchar = 7181 ;; enter1  .let fldnum = @if(fldnum=fldcnt,1,fldnum+1)$  .case sys:lchar = 18432 ;; up3 .let fldnum = @if(fldnum=1,fldcnt,fldnum - 1)%  .case sys:lchar= 20480 ;; down1  .let fldnum = @if(fldnum=fldcnt,1,fldnum+1)&  .case sys:lchar = 19200 ;; left&  .let fldnum = @max(fldnum - 1,1)#  .case sys:lchar= 3849 ;; tab1  .let fldnum = @if(fldnum=fldcnt,1,fldnum+1)&  .case sys:lchar= 19712 ;; right1  .let fldnum = @if(fldnum=fldcnt,1,fldnum+1)&  .case sys:lchar = 18176 ;; home .let fldnum = 1%  .case sys:lchar= 18688 ;; pgup .let fldnum = 1%  .case sys:lchar= 20736 ;; pgdn .let fldnum = fldcnt*  .case sys:lchar = 3840 ;; shift/tab& .let fldnum = @max(fldnum - 1,1))  .case sys:lchar = 12813 ;; Contr/MR  .macro {send}(s) second edit - make adjustments if needed alt/end to finish ~A  .macro {F9}wls{6x}{Down}{Up}{9x}{Right}{3x}{Left}{Esc}{Home} .input weewin.let fldnum = 6 >.case sys:lchar =22784 ;;shift/f6send the message as is .output screen off .REFORMAT ON, .output ASCII on c:\windows\temp\n.c-f [puts[1]]-t [puts[2]].if @match(puts[3],"@") <> 0-cc [puts[3]].endif.if lattach<>' '-a [lattach].endif-u [puts[4]]-omessage-file=O.A-smail.netspace.net.au/ .output ASCII close C:\WINDOWS\temp\n.c .REFORMAT OFF* .output ASCII on c:\windows\temp\O.A>from: [lawti[1]] to: [lawti[2]] [sys:date] [sys:time].if puts[3]<>' ' cc : [lawti[3]]-.else.endifSubject: [puts[4]8] [weewin]. .output ASCII close c:\windows\temp\O.A 6.exec_dos c:\windows\temp\sendemail -o config=n.c .mtrimr(weewin,weewin) .mconcat ("",weewin,msma)  .let mssub=puts[4] .let msdate=sys:date .let mstime=sys:time .let msad=puts[2] .let mscc=puts[3] .let mssender=puts[1] .let msat=lattach .add ms .escape ons .macro {gotow}neword~{IF ERROR}{else}{&end}{ifbox}y{endif}{endif}{GOTOW}email~{gotow}email~{esc}{&end}{^f10}y .input   .let fldnum=6 .endcase.return.label neweditR  .macro {send}(s) second edit - make adjustments if needed alt/end to finish ~A  .macro {F9}wls{6x}{Down}{Up}{9x}{Right}{3x}{Left}{Esc}{Home} .input weewin.let fldnum = 6 .escape on.return