home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
mal2moz1.zip
/
pmmail.cmd
< prev
Wrap
OS/2 REXX Batch file
|
2002-06-05
|
4KB
|
106 lines
/* PmmailMozilla.cmd version 1.00 */
/* script to start Pmmail from Mozilla via the mailto: link */
/* */
/* to use this script you have to change the prefs.js file */
/* please add/change the following three lines in prefs.js */
/* please change "H:\\temp\\pmmail.cmd" with your path to pmmail.cmd */
/* user_pref("applications.mailto", "H:\\temp\\pmmail.cmd"); */
/* user_pref("applications.mailto.parameters", "\"%url%\""); */
/* user_pref("network.protocol-handler.external.mailto", true); */
/* */
/* You have also to change line 16 and 20 in this script */
/* (c) 04.06.2002 Oliver Poggensee op@opweb.de http://www.opweb.de */
/* full path to the pmmail.exe */
/* Please change the line below to your needs */
program = "H:\online\pmmail\pmmail.exe"
/* name of the Pmmail account you want to use */
/* leave it blank if you have only one account, or want to use the default one */
/* Please change the line below to your needs */
defaultAcount = "opweb"
Parse arg url /* Get the argument */
part. = "" /* All part.* variables are now empty */
url = Strip(url) /* delete leeding and traling spaces */
url = Right(url, Length(url) -2)
url = Left(url, Length(url) - 2)
Parse Var url part.email "?" url /* Check if there are more parameters than the emailaddress */
i = 0 /* the first parameter starts with a "?" all other with a "&" */
Do While url \= ""
i = i + 1
Parse Var url part.i "&" url
say part.i
End
part.0 = i
Do i = 1 To part.0 /* build substrings for the parameters so that pmmail */
If i = 1 Then /* can understand them */
delim = "?"
Else
delim = "&"
Select
When Translate(Left(part.i, 2)) = "CC" Then
part.i = delim || "cc=" || Right(part.i, Length(part.i) -3)
When Translate(Left(part.i, 3)) = "BCC" Then
part.i = delim || "bcc=" || Right(part.i, Length(part.i) -4)
When Translate(Left(part.i, 7)) = "SUBJECT" Then
part.i = delim || "subject=" || Right(part.i, Length(part.i) -8)
When Translate(Left(part.i, 4)) = "BODY" Then
part.i = delim || "body=" || Right(part.i, Length(part.i) -5)
Otherwise
End
End
/* build a string to invoke pmmail */
startstring = program /* pmmail.exe */
if defaultAcount \= "" Then
startstring = startstring "/s" defaultacount /* account name */
if part.email \= "" Then
startstring = startstring '"' || "mailto:" || part.email /* emailaddress */
Do i = 1 To part.0 /* other parameters */
startstring = startstring || part.i
End
startstring = startstring || '"'
out = "" /* change the URL encoded spacial characters */
Parse Var startstring left "%0A" rest /* (%0A, %0D, %20) to spaces, since I can't get */
startstring = rest /* them work in Pmmail */
out = out left
Do While rest \= ""
Parse Var startstring left "%0A" rest
startstring = rest
out = out left
End
startstring = out
out = ""
Parse Var startstring left "%0D" rest
startstring = rest
out = out left
Do While rest \= ""
Parse Var startstring left "%0D" rest
startstring = rest
out = out left
End
startstring = out
out = ""
Parse Var startstring left "%20" rest
startstring = rest
out = out left
Do While rest \= ""
Parse Var startstring left "%20" rest
startstring = rest
out = out left
End
startstring = out
startstring /* Start Pmmail with all the parameters */
return