Okay, here is my attempt at a Powerpro mailto: command.
It works almost perfectly, and with Thunderbird too.
The only place it fails (so far) is if you copy the entire function to 
the clipboard and try to send that.
Watch for wordwrap!

;Here is the test function (copy something to the clipboard first!):
function testmail()
     ....@makemail("[email protected]", "My subject", clip.get)
     quit
--------------------------------------------------
function email(recipient,subject,body)
     recipient = ....@uriencoder(recipient)
     subject = ....@uriencoder(subject)
     body = ....@uriencoder(body)
     local runline = "mailto:"; ++ recipient ++ "?subject=" ++ subject ++ 
"&body=" ++ body
     ;win.debug(runline)
     do(runline)
     quit
function uriEncoder(theuri)
     local string = theuri
     string = replacechars(string,"%","%25")
     string = replacechars(string,";","%3B")
     string = replacechars(string,"\t","%20%20%20%20%20")
     string = replacechars(string," ","%20")
     string = replacechars(string,"\r","%0A")
     string = replacechars(string,"\n","%0D")
     string = replacechars(string,"\"","%22")    ;;"    -I just put this 
here to escape out of the " for my syntax highlighting
     string = replacechars(string,"\'","%27")
     string = replacechars(string, "\\","%5C")
     string = replacechars(string, "<","&lt;")
     string = replacechars(string, ">","&gt;")
     string = replacechars(string,"&","%26")
     quit(string)




Reply via email to