home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / cdity / BlocNotes39.lha / BlocNotes / PrepMail.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1996-05-23  |  919 b   |  43 lines

  1. /*Simple script to create a mail form within a note*/
  2.  
  3. address 'blocnotes.rexx'
  4. options results
  5.  
  6. /*Get the id of the note*/
  7.  
  8. parse arg id .
  9.  
  10. email=getvar('EMAILADDR')
  11. if email='' then do
  12.    User=getvar('USER')
  13.    Host=getvar('HOST')
  14.    email=User||'@'||Host
  15. end
  16.  
  17. ISANOTE id
  18. if result then do     /* Check if the id is valid*/
  19.    INFO id
  20.    infos=COMPRESS(result)        /* Check if the note is empty*/
  21.    if LENGTH(infos)=3 then do
  22.       SETINSTIME 0               /* Initialize default parameters */
  23.       INSERT id ON
  24.       EDIT id ON
  25.       SIZE id 0 0 640 300
  26.  
  27.       IMPORT id 'UULIB:.signature'  /* Import signature file(only one user, sorry!)*/
  28.  
  29.       GO id 0 0                   /*Insert To and Subject tags*/
  30.       PRINT id 'To:!n'
  31.       PRINT id 'Reply-To: '||email||'!nSubject:!n!n'
  32.       GO id 4 0
  33.    end
  34. end
  35.  
  36. exit
  37.  
  38. getvar:
  39. filename='ENV:'||arg(1)
  40. call open('var',filename)
  41. string=readln('var')
  42. return string
  43.