home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / comm / mail / YAMscripts.lha / YAMmail.rexx < prev    next >
OS/2 REXX Batch file  |  1996-11-22  |  898b  |  32 lines

  1. /* YAMmail.rexx 1.0 by knikulai@utu.fi
  2. */
  3. subject='Mail from your web page'
  4.  
  5. Options Results
  6. parse arg email /* an adress could become useful later...*/
  7.  
  8. if show('P','YAM')=0 then do           /* YAM is not running yet, so let's start it */
  9.   address command 'run <>nil: yam:yam nocheck'
  10.   i=0
  11.   do until show('P','YAM')>0 | i=3     /* Let's not wait more than 30 seconds */
  12.     address command 'sys:rexxc/WaitForPort YAM'
  13.     i=i+1
  14.   end /* do */
  15.   if show('P','YAM')=0 then exit
  16. end
  17.  
  18. /* Now we know YAM is up and running */
  19.  
  20. njaah=pos('?SUBJECT=',upper(email))
  21. if njaah>0 then do
  22.     subject=right(email,length(email)-njaah-8)
  23.     email=left(email,njaah-1)
  24.     end
  25. address 'YAM'              /* The following commands are sent to YAM */
  26. 'Show'                /* Uniconify */
  27. 'MailWrite'                /* Press 'Write'-button */
  28. 'WriteMailTo "'||email||'"'     /* Set address */
  29. 'WriteSubject "'||subject||'"'     /* Set subject */
  30.  
  31. exit
  32.