Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

This form is painful. Help!

Status
Not open for further replies.

WayneC

IS-IT--Management
Jun 22, 2001
6
GB
This is the code I am using and below is the result I am getting. Please can anyone throw any light on it.

Waynec


- - - - - - - - - -

# Use the CGI unit
use CGI;

# Get the values from the form
$form = new CGI;

$subject="MOT Booking";
$tome="mot\@station-garage.net";
$fromme="Customer request";
$server="smtp.station-garage.net";
$message=$form->param('message');

$server="smtp.station-garage.net";
$make=$form->param('make');
$model=$form->param('model');
$regnumber=$form->param('regnumber');
$fuel=$form->param('fuel');
$lastname=$form->param('lastname');
$firstname=$form->param('firstname');
$address1=$form->param('address1');
$address2=$form->param('address2');
$city=$form->param('city');
$county=$form->param('county');
$postcode=$form->param('postcode');
$month=$form->param('month');
$date=$form->param('date');
$year=$form->param('year');
$time=$form->param('time');
$std=$form->param('std');
$number=$form->param('number');
$email=$form->param('email');

$lt='<';
$gt='>';

# Save the message into a text file
open (messtxt,&quot;>message.txt&quot;);

print messtxt ($make, &quot;\n&quot;);

print messtxt ($model, &quot;\n&quot;);

print messtxt ($regnumber, &quot;\n&quot;);

print messtxt ($fuel, &quot;\n&quot;);

print messtxt ($lastname, &quot;\n&quot;);

print messtxt ($firstname, &quot;\n&quot;);

print messtxt ($address1, &quot;\n&quot;);

print messtxt ($address2, &quot;\n&quot;);

print messtxt ($city, &quot;\n&quot;);

print messtxt ($county, &quot;\n&quot;);

print messtxt ($postcode, &quot;\n&quot;);

print messtxt ($month, &quot;\n&quot;);

print messtxt ($date, &quot;\n&quot;);

print messtxt ($year, &quot;\n&quot;);

print messtxt ($time, &quot;\n&quot;);

print messtxt ($std, &quot;\n&quot;);

print messtxt ($number, &quot;\n&quot;);

print messtxt ($email, &quot;\n&quot;);

close messtxt;

- - - - - - - - - - - -

This is what I am getting back when sending the form and it is not sending the data to the mail server.

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


Sending message.txt to mot@station-garage.net
Subject:MOT Booking
Login name is Customer request
blat.exe message.txt -s &quot;MOT Booking&quot; -t &quot;mot@station-garage.net&quot; -f &quot;Customer request&quot; -server smtp.station-garage.net&quot; Done.Mail sent to .
 
I can't tell exactly what is going on from the code you posted. However, it appears that you may be getting a response from 'blat.exe' and that response is being send back through the web server. That might not be a problem, but, the web server needs to output compliant httpd headers before anything else.

You might try,

#!perl
use CGI;
$form = new CGI;
print $form->header, $form->start_html,
&quot;<p>Sending stuff to blat</p>\n&quot;;



$subject=&quot;MOT Booking&quot;;
$tome=&quot;
Code:
mot\@station-garage.net
&quot;;
$fromme=&quot;Customer request&quot;;
$server=&quot;smtp.station-garage.net&quot;;
$message=$form->param('message');

# and so on......



HTH If you are new to Tek-Tips, please use descriptive titles, check the FAQs,
and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top