[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Way OT] perl, CGI, and sendmail



On Sun, Apr 10, 2005 at 05:27:34PM -0500, David wrote:
> On Sun, Apr 10, 2005 at 11:25:48PM +0200, Almut Behrens wrote:
> > When a CGI script doesn't produce any output, it's
> > considered an "internal error" by the server.
> 
> But I was getting output.  In the sendmail example I included, I
> received a perfect mail.  As I said in the OP, no errors showed up in
> the exim logs, but I'd get an "Internal Error" report in the web browser

With output I meant _output sent to the browser_ -- i.e. printed to
stdout.  In your script, you're just printing a message to SENDMAIL.
Sending this mail is considered just a "side effect" CGI-wise.  You
still have to generate some HTML content to be sent to the browser.
IOW, after your "print SENDMAIL <<"end_html"; ..." statement, add some
code to send HTML content to stdout.  Or, use HTTP status code 204. 
To start with, however, it's probably easier to just generate any page
to be shown in response to submitting the form... :)

Almut




Reply to: