home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Amiga / Internet / Mail / EMail2STFax.lha / EMail2STFax / SendFax.thor < prev   
Text File  |  1997-12-19  |  1KB  |  65 lines

  1. /*
  2. * $VER SendFax.thor 1.1 (13.12.97)
  3. *
  4. * SendFax.thor v 1.0 by Pietro Altomani (altomanipietro@pragmanet.it)
  5. *              v 1.1 changes by Simone Tellini
  6. *
  7. * Faxes the current message with the powerful fax program STFax by Simone Tellini.
  8. *
  9. * Usage: launch it from Thor,it will ask you for the fax number you want
  10. * to send current message to. The number could be given as argument, too.
  11. * The script could be launched also by SortMail.
  12. * So you will able to make a simple e-mail to fax gateway.
  13. */
  14.  
  15. TempFax = "STFax:Fax_Out/Thor2Fax.stf"
  16.  
  17. OPTIONS RESULTS
  18. OPTIONS FAILAT 11
  19. PARSE ARG argument
  20. IF SHOW("P","STFAX.1") = 0 then
  21. do
  22.   if EXISTS("STFAX:STFax") then do
  23.       ADDRESS COMMAND "RUN <>NIL: STFax:STFax"
  24.       ADDRESS COMMAND "WaitForPort STFAX.1"
  25.     end
  26.   else
  27.     do
  28.       SAY "STFax not found. Cannot send fax."
  29.       exit 10
  30.     end
  31. end
  32.  
  33. p=' '||ADDRESS()||' '||SHOW('P',,)
  34. IF POS(' THOR.',p)>0 THEN thorport=WORD(SUBSTR(p,POS(' THOR.',p)+1),1)
  35. ELSE DO
  36.   SAY 'THOR port not found!'
  37.   EXIT 10
  38. END
  39. Address(thorport)
  40. if(argument='') then
  41. do
  42.   REQUESTSTRING TITLE '"Enter destination fax number:"' BT '"_Ok|_Cancel"'
  43.   if(rc ~= 0) then exit
  44.   number=result
  45. end
  46. else number=argument
  47.  
  48. ADDRESS COMMAND 'Delete "t:fax.tmp" >NIL:'
  49. Address(thorport)
  50. SAVEMESSAGE FILENAME "t:fax.tmp" CURRENT
  51.  
  52. ADDRESS STFAX.1
  53. NEW FORCE
  54. ADDTEXT "t:fax.tmp"
  55. ADDRESS COMMAND 'Delete "t:fax.tmp" >NIL:'
  56. SAVEAS TempFax
  57. SEND number
  58. IF rc=10 THEN do
  59.   SAY "Sending Fax failed!!!"
  60.   exit
  61. end
  62. exit
  63.  
  64.  
  65.