Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: CGI Form / Email

From: cybarite:sympatico:ca at: 31-Mar-2002 11:13

Hi Koie, If you are trying to have the request form posted and handled by a REBOL script invoked by CGI, I don't follow why you want the email send. Your CGI script will have all of the data that was posted to your web address. You can simply write them to a journal file to process later with write/append If you want to send a reply to the person who raised the request, you would not normally use email to accomplish that but just send that back on the reply to the post. If you want to send an alert to another user to tell them something's been logged, then you might just send the URL to retrieve the data from the journal file. e.g. send [customer--service--my-company--com] {New Item A new entry has been added to the journal for your action. See http://my-company.com/cgi-bin/get-item.r?key=123456789 } Then you need to add script get-item.r to do the lookup and supply the information that is needed. The basics that you have with the decode-cgi make this a very easy task. or at least that is what I would do ... rather than email. ----- Original Message ----- From: "mechtn" <[mechtn--charter--net]> To: <[rebol-list--rebol--com]> Sent: Sunday, March 31, 2002 12:58 PM Subject: [REBOL] CGI Form / Email
> Hi, I am working on a cgi form/email program to create a support request
form for my company..
> So far its going pretty well except i cant figure out how to break the
fields apart even more than just from/subject/message... i want them to fill out multiple fields and it list it all in the message...
> currently my code looks like.. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > #!rebol -cs > > REBOL [ > Title: "Sends Support Request via CGI Form" > Date: 29-March-2002 > File: %cgiemailer.r > Purpose: { > Uses a Web form to send an support request (email) message. > } > Category: [cgi email markup net 3] > ] > > supportmail: [support--nex-tekinc--com] > > system/user/email: [support--nex-tekinc--com] > system/schemes/default/host: "mail.nex-tekinc.com" > > print "Content-Type: text/html^/" ;-- Required Page Header > > print "<html><body><h2>Results:</h2>" > > cgi: make system/standard/email decode-cgi system/options/cgi/query-string > > either all [ > email? try [cgi/email: load cgi/email] > ][ > print [<B> "Sending Support Request Now"</B><br>] > send/header [ksmith--nex-tekinc--com] cgi/content cgi > ][ > print "<B>Invalid email to or from address</B>" > ] > > print [ > "Customer Number:" <B> cgi/custnum </B><P> > "Email:" <B> cgi/email </B><P> > "Name:" <B> cgi/name </B><P> > "Problem:" <B> cgi/content </B><P> > ] > print "</body><html>" > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > I have the following fields in the webpage.. > custnum > email > name > content > > My goal is to have the customer number appear in the subject, and any
other information like name and problem appear in the message body.. I may have more than just these two fields once its all said and done..