Internet communication through a Firewall

Ken Ray kray at sonsothunder.com
Tue Sep 28 15:55:49 EDT 2004


On 9/28/04 7:44 AM, "Alejandro Tejada" <capellan2000 at yahoo.com> wrote:

> I want that my courseware stack, send me an e-mail
> using a perl cgi in my website.

You should be able to communicate with the perl cgi in the same way you'd
call it from a browser. That is, suppose your cgi would be called through a
browser form with a url that would end up like this:

  http://www.myweb.com/cgi-bin/mailme.cgi?subject=Test&body=Test2

You could use the "post" command to send that data to the CGI, as in:

on mouseUp
  put urlEncode(fld 1) into tSubject
  put urlEncode(fld 2) into tBody
  put "http://www.myweb.com/cgi-bin/mailme.cgi" into tCGI
  put "subject=" & tSubject & "&body=" & tBody into tStuffToPost

  post tStuffToPost to url tCGI
  if trim(it) <> "ok" then
    answer the result titled "Transmission Error"
    return "error"
  else
    answer "Thank you for your email!" titled "Transmission Successful"
  end if
end mouseUp

function trim what
  local tText
  get matchText(what,"(?s)\s*(\S.*\S)\s*",tText)
  return tText
end trim

(I added the "trim" in because sometimes I get a space before "OK" from my
server.)

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the metacard mailing list