It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CGI and Perl Forum

email form

email form

Postby dazz_club on Thu Nov 02, 2006 12:26 am

Hi people,

Im having trouble editing this cgi contact form, when i submit this errors shows on the next page

"CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers."

any ideas?

heres the coding to send the email
Code: Select all
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
print "Content-type: text/html \n\n";
print "hello world";
# Website Contact Form Generator
# http://www.tele-pro.co.uk/scripts/contact_form/
# This script is free to use as long as you 
# retain the credit link 

# get posted data into local variables
$input = new CGI;
$EmailFrom = $input->param('EmailFrom');
$EmailTo = "dxxxxxxxx\@xxxxxxxx.com";
$Subject = "Win a Xmas Hamper";
$name = $input->param('name');
$email = $input->param('email');
$telephone = $input->param('telephone');
$company = $input->param('company');
$address1 = $input->param('address1');
$address2 = $input->param('address2');
$address3 = $input->param('address3');
$postcode = $input->param('postcode');

# validation
$validationOK='true';
if ($EmailFrom eq '') {$validationOK='false';}
if ($validationOK eq 'false') {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}

# prepare email body text
$Body = "Xmas Competition - Colour Change:";
$Body .= "\n";
$Body .= "\n";

$Body .= "Their Name: ";
$Body .= "$name";
$Body .= "\n";.

$Body .= "Their Email: ";
$Body .= "$email";
$Body .= "\n";

$Body .= "Their telephone number: ";
$Body .= "$telephone";
$Body .= "\n";


$Body .= "Their Company: ";
$Body .= "$company";

$Body .= "Their Address: ";
$Body .= "$address1";
$Body .= "$address2";
$Body .= "$address3";


$Body .= "$postcode";
# send email
use Win32::OLE;
$ex = Win32::OLE->new('CDONTS.NewMail') or die "\nCDONTS error";
$ex->Send($EmailFrom,$EmailTo,$Subject,$Body);

# redirect to success page
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.html\">";


cheers
User avatar
dazz_club
250+ Club
 
Posts: 313
Joined: Fri Jul 15, 2005 7:35 am
Location: Chester and Hull

Who is online

Users browsing this forum: No registered users and 0 guests