home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 52
/
Amiga_Dream_52.iso
/
Amiga
/
Internet
/
Mail
/
EMail2STFax.lha
/
EMail2STFax
/
SendFax.thor
< prev
Wrap
Text File
|
1997-12-19
|
1KB
|
65 lines
/*
* $VER SendFax.thor 1.1 (13.12.97)
*
* SendFax.thor v 1.0 by Pietro Altomani (altomanipietro@pragmanet.it)
* v 1.1 changes by Simone Tellini
*
* Faxes the current message with the powerful fax program STFax by Simone Tellini.
*
* Usage: launch it from Thor,it will ask you for the fax number you want
* to send current message to. The number could be given as argument, too.
* The script could be launched also by SortMail.
* So you will able to make a simple e-mail to fax gateway.
*/
TempFax = "STFax:Fax_Out/Thor2Fax.stf"
OPTIONS RESULTS
OPTIONS FAILAT 11
PARSE ARG argument
IF SHOW("P","STFAX.1") = 0 then
do
if EXISTS("STFAX:STFax") then do
ADDRESS COMMAND "RUN <>NIL: STFax:STFax"
ADDRESS COMMAND "WaitForPort STFAX.1"
end
else
do
SAY "STFax not found. Cannot send fax."
exit 10
end
end
p=' '||ADDRESS()||' '||SHOW('P',,)
IF POS(' THOR.',p)>0 THEN thorport=WORD(SUBSTR(p,POS(' THOR.',p)+1),1)
ELSE DO
SAY 'THOR port not found!'
EXIT 10
END
Address(thorport)
if(argument='') then
do
REQUESTSTRING TITLE '"Enter destination fax number:"' BT '"_Ok|_Cancel"'
if(rc ~= 0) then exit
number=result
end
else number=argument
ADDRESS COMMAND 'Delete "t:fax.tmp" >NIL:'
Address(thorport)
SAVEMESSAGE FILENAME "t:fax.tmp" CURRENT
ADDRESS STFAX.1
NEW FORCE
ADDTEXT "t:fax.tmp"
ADDRESS COMMAND 'Delete "t:fax.tmp" >NIL:'
SAVEAS TempFax
SEND number
IF rc=10 THEN do
SAY "Sending Fax failed!!!"
exit
end
exit