Sending mail via libSMTP on cgi

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Sending mail via libSMTP on cgi

Thomas McCarthy

There is egg on my cgi face.
1. form mail is only used for recieving submissions--not for sending out emails to various address.

2. I tried plan B (use rev) I uploaded Andre's Raw SMTP stack (after adapting it for testing) Failed. Then I remembered my host won't allow sockets to be opened.

3. Plan C: Ask the RevList.

I've already given up on the idea of running a rev chat program from my host server (socket problem, again). I may have to give up this idea as well.

tom


_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Basic Object Address Question

David Burgun
Hi,


I am a bit confused, should the following code work?

put the long name of card 1 into myCardName
put the name of control 1 of card myCardName into myControlName

I get an error when I try to do this and changed the code to:

put the name of control 1 of card myCard of stack myStack into my ControlName

Which is ok, but what I really want to be able to do is this:

put long name of group myGroup into myGroupName -- String of
something like "group x of group y of group z of card c of stack s"
put the name of group myGroupName into myGroupName.


Any Ideas?

Thanks a lot
Dave

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Basic Object Address Question

Andre Garzia

Dave,

it's just a mistake, see that when you put the long name of a control  
into a var, that variable also contains the type of control, it's a  
complete reference. for example, on a newly created stack, the long  
name of card 1 returns:

card id 1002 of stack "Untitled 1"

So if you put the long name of a control into a variable, when you're  
using it, you don't need the control kind, so your example should be:

put the long name of card 1 into myCardName
put the name of control 1 of myCardName ....


See?

Cheers
andre


On Aug 23, 2005, at 12:00 PM, David Burgun wrote:

> Hi,
>
>
> I am a bit confused, should the following code work?
>
> put the long name of card 1 into myCardName
> put the name of control 1 of card myCardName into myControlName
>
> I get an error when I try to do this and changed the code to:
>
> put the name of control 1 of card myCard of stack myStack into my  
> ControlName
>
> Which is ok, but what I really want to be able to do is this:
>
> put long name of group myGroup into myGroupName -- String of  
> something like "group x of group y of group z of card c of stack s"
> put the name of group myGroupName into myGroupName.
>
>
> Any Ideas?
>
> Thanks a lot
> Dave
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Basic Object Address Question

Eric Chatonet
In reply to this post by David Burgun
Dave,

Try:

put long name of group myGroup into myGroupName
-- myGroupName is now a variable that includes all information about  
the control
-- so you do not need to write: put the name of group myGroupName,  
but only:
put the short name of myGroupName

Le 23 août 05 à 17:00, David Burgun a écrit :

> Hi,
>
>
> I am a bit confused, should the following code work?
>
> put the long name of card 1 into myCardName
> put the name of control 1 of card myCardName into myControlName
>
> I get an error when I try to do this and changed the code to:
>
> put the name of control 1 of card myCard of stack myStack into my  
> ControlName
>
> Which is ok, but what I really want to be able to do is this:
>
> put long name of group myGroup into myGroupName -- String of  
> something like "group x of group y of group z of card c of stack s"
> put the name of group myGroupName into myGroupName.
>
>
> Any Ideas?
>
> Thanks a lot
> Dave


Best Regards from Paris,

Eric Chatonet.
----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch

Free plugins and tutorials on my website
----------------------------------------------------------------
Web site        http://www.sosmartsoftware.com/
Email        [hidden email]/
Phone        33 (0)1 43 31 77 62
Mobile        33 (0)6 20 74 50 86
----------------------------------------------------------------

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Sending mail via libSMTP on cgi

Ken Ray
In reply to this post by Thomas McCarthy
On 8/23/05 9:25 AM, "Thomas McCarthy" <[hidden email]> wrote:

> There is egg on my cgi face.
> 1. form mail is only used for recieving submissions--not for sending out
> emails to various address.
>
> 2. I tried plan B (use rev) I uploaded Andre's Raw SMTP stack (after adapting
> it for testing) Failed. Then I remembered my host won't allow sockets to be
> opened.
>
> 3. Plan C: Ask the RevList.
>
> I've already given up on the idea of running a rev chat program from my host
> server (socket problem, again). I may have to give up this idea as well.

Is your host server running Linux? If so, there should be a 'sendmail'
program either in the 'bin' or 'usr/bin' folders that you can use a Rev CGI
with. Here's an example of a CGI I use (based on Richard Gaskin's standard
CGI lib) that sends bug report emails to me from RevZilla (see the "mailMe"
handler for the good stuff). Obviously it can be adapted for general use.
(Watch for line wraps!)

-----------
#!mc

local sInArray, sCommand, sKeys, sOutData

--| RevZilla Bug Reporting CGI
--| Version: 1.1
--|
--|
--| Used for forwarding bug reports submitted on RevZilla

on startup
  StartCGI
  --
  put "Summary: " & sInArray["summary"] & cr & cr & "Description: " &
sInArray["desc"] & cr & cr & "From: " & sInArray["email"] into tMessage
  mailMe tMessage
  put "ok" into sOutData
      --
  EndCGI
end startup


on mailMe pMessage
  put "/usr/sbin/sendmail -t" into mprocess
  put "Bug report dated: " & (the short date) & cr & "----------" & cr & cr
& urldecode(pMessage) into pMessage
 
  open process mprocess for write
 
  write "From:" && "[hidden email]" & cr to process mprocess
  write "To:" && "[hidden email]" & cr to process mprocess
  write "Subject:" && "RevZilla Bug Report" & cr & cr to process mprocess
  write pMessage & cr to process mprocess
 
  close process mprocess
  wait until the openprocesses is empty
end mailMe

--==============================================================--
-- 4w std cgi lib
--

on StartCGI
  put GetPostDataArray() into sInArray
  put the keys of sInArray into sKeys
  put sInArray["cmd"] into sCommand
end StartCGI

on EndCGI
  SendDataBackToClient sOutData
end EndCGI


function GetPostData
  global gTestlocal, gCgiIn
  if gTestlocal is true then
    return gCgiIn
  else
    if $REQUEST_METHOD is "POST" then
      put $CONTENT_LENGTH into tLen
      repeat
        read from stdin until empty
        put it after tInput
        if tLen = length(tInput) then
          exit repeat
        end if
      end repeat
      return tInput
    else
      put "Error calling CGI:  Data must be sent as POST."
    end if
  end if
end GetPostData


function GetPostDataArray
  put GetPostData() into tData
  split tData by "&" and "="
  return tData
end GetPostDataArray


on SendDataBackToClient
  global gTestlocal, gCgiOut
  if gTestlocal is true then
    put sOutData into gCgiOut
  else
    put "Content-Type: text/html" & crlf &\
        "Content-Length:"&& length(sOutData) & crlf & crlf
    put sOutData
  end if
end SendDataBackToClient

Enjoy!



Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: Basic Object Address Question - and wrapper answers sauce a la TAOO

MisterX
In reply to this post by Eric Chatonet
> On Behalf Of Eric Chatonet
> Dave,
>
> Try:
>
> put long name of group myGroup into myGroupName
> -- myGroupName is now a variable that includes all information about  
> the control
> -- so you do not need to write: put the name of group myGroupName,  
> but only:
> put the short name of myGroupName

Eric,

This is my favorite way to talk to objects...

  put the long name of control x into thisobject

you can "do" everything "safely" now to your thisobject...

  set the rect of this object to arect

except assuming thisobject is a field

  delete line 2 of thisobject

or worse

  put empty into thisfield

you are then working on the variable, emptying it's valuable content...
so this requires the clever dynamic script trick i love so much:

  do "put empty into" && thisfield

[see the "do" command in the revdocs ;)]

Test it a bit... to avoid lengthy checking of what went wrong
try first to
  get <command string> -- eg "get the time"
  do it

If you breakpoint after the "get", you can easily see the command that is
going to be fed to the compiler... eh, sorry, interpreter... Dynamic scripts
are slower - but not that slow...

- wrappers a la Taoo - delicious with a great IDE like Rev...

This lends itself to wrappers anytime! How to build your own libraries? ...

do something to this library context object...
so in brief, we modularize and normalize (reduce) handlers to their minimum
such that they are strictly <verb><object> <params>. Here for a field class
library we have a great example... <verb><field> with some exceptions that
require dynamic scripting.

And it's the way TAOO or many other libraries work too - using both the
basic long name reference and the dynamic execution. I know some expensive
tools that dont do this and they suffer badly from it! Remember the key is
to use the long name. It avoids all confusions.

on ClearFields objs
  repeat for each line thisobj in objs
   if exists(thisobj)
   then do "put empty into" && thisobj
  end repeat
end ClearFields

For more examples, try my geometry manager GIM.rev on MonsieurX.com (easy to
'find').

Since the long name contains the full path to any control, you can't miss
working on the right field or tripping on a changed-name field!!!

Remember also that the long ID of a control is less likely to change within
a stack than a long name. That's assuming you dont replicate this one to
other stacks where names dont change but IDs do! - IDs have their short
comings too...

And so with that concludes this little trick of TAOO wrapping and Xtalk
object addressing in the single, plural form ;)

More about this very soon (ed.)

cheerios
Xavier
http://monsieurx.com/taoo


> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> Eric Chatonet
> Sent: Tuesday, August 23, 2005 17:09
> To: How to use Revolution
> Subject: Re: Basic Object Address Question
>
> Dave,
>
> Try:
>
> put long name of group myGroup into myGroupName
> -- myGroupName is now a variable that includes all information about  
> the control
> -- so you do not need to write: put the name of group myGroupName,  
> but only:
> put the short name of myGroupName
>
> Le 23 août 05 à 17:00, David Burgun a écrit :
>
> > Hi,
> >
> >
> > I am a bit confused, should the following code work?
> >
> > put the long name of card 1 into myCardName
> > put the name of control 1 of card myCardName into myControlName
> >
> > I get an error when I try to do this and changed the code to:
> >
> > put the name of control 1 of card myCard of stack myStack into my  
> > ControlName
> >
> > Which is ok, but what I really want to be able to do is this:
> >
> > put long name of group myGroup into myGroupName -- String of  
> > something like "group x of group y of group z of card c of stack s"
> > put the name of group myGroupName into myGroupName.
> >
> >
> > Any Ideas?
> >
> > Thanks a lot
> > Dave
>
>
> Best Regards from Paris,
>
> Eric Chatonet.
> ----------------------------------------------------------------
> So Smart Software
>
> For institutions, companies and associations
> Built-to-order applications: management, multimedia, internet, etc.
> Windows, Mac OS and Linux... With the French touch
>
> Free plugins and tutorials on my website
> ----------------------------------------------------------------
> Web site        http://www.sosmartsoftware.com/
> Email        [hidden email]/
> Phone        33 (0)1 43 31 77 62
> Mobile        33 (0)6 20 74 50 86
> ----------------------------------------------------------------
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Basic Object Address Question

David Burgun
In reply to this post by Eric Chatonet
Great! Thanks a lot!!!

Dave



>,
>
>Try:
>
>put long name of group myGroup into myGroupName
>-- myGroupName is now a variable that includes all information about
>the control
>-- so you do not need to write: put the name of group myGroupName, but only:
>put the short name of myGroupName
>
>Le 23 août 05 à 17:00, David Burgun a écrit :
>
>>Hi,
>>
>>
>>I am a bit confused, should the following code work?
>>
>>put the long name of card 1 into myCardName
>>put the name of control 1 of card myCardName into myControlName
>>
>>I get an error when I try to do this and changed the code to:
>>
>>put the name of control 1 of card myCard of stack myStack into my ControlName
>>
>>Which is ok, but what I really want to be able to do is this:
>>
>>put long name of group myGroup into myGroupName -- String of
>>something like "group x of group y of group z of card c of stack s"
>>put the name of group myGroupName into myGroupName.
>>
>>
>>Any Ideas?
>>
>>Thanks a lot
>>Dave
>
>
>Best Regards from Paris,
>
>Eric Chatonet.
>----------------------------------------------------------------
>So Smart Software
>
>For institutions, companies and associations
>Built-to-order applications: management, multimedia, internet, etc.
>Windows, Mac OS and Linux... With the French touch
>
>Free plugins and tutorials on my website
>----------------------------------------------------------------
>Web site        http://www.sosmartsoftware.com/
>Email        [hidden email]/
>Phone        33 (0)1 43 31 77 62
>Mobile        33 (0)6 20 74 50 86
>----------------------------------------------------------------
>
>_______________________________________________
>use-revolution mailing list
>[hidden email]
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution