Can anyone see any glaring omissions/errors in this script? It was working one day and then no the next. I'm 99.9% sure it hasn't been altered and would just like someone to confirm that it is the server and not me going mad.
At the moment all it gives me is a "CGI ERROR The specified CGI application misbehaved by not returning a complete set of HTTP headers."
!/usr/bin/perl
use OLE;
use CGI;
$jmail = CreateObject OLE "JMail.SMTPMail";
$form = new CGI;
$Recipient="genuine@address.co.uk";
$name=$form->param('name');
$fromEmail=$form->param('fromEmail');
$PreBody=$form->param('body');
$Body=$PreBody."\n\n".$name;
$domain = $ENV {'SERVER_NAME'};
$referer = $ENV {'HTTP_REFERER'};
$url = $referer;
$url =~ s/^http:\/\///i;
$url =~ s/^$domain =~ s/^
$Sender = "$fromEmail";
$SMTPServer = "smtp.$domain:25";
$Subject = "Crispini Website Feedback";
$Priority=3;
$Header = "Originating-IP", $ENV{'REMOTE_ADDR'};
$jmail->{ServerAddress} = $SMTPServer;
$jmail->{Sender} = $Sender;
$jmail->{Subject} = $Subject;
$jmail->AddRecipient ($Recipient);
$jmail->{Body} = $Body;
$jmail->{Priority} = $Priority;
$jmail->AddHeader ($Header);
if ($url =~ m/^$domain/)
{
$mailmessage = "mail sent";
$jmail->Execute;
}
else
{
print "Content-type: text/html\n\n";
$mailmessage = "mail was not sent. Incorrect Referer";
}
print "location:
I have basically copied and pasted this script as I'm not a PERL programmer (Thankfully ; )
Thanks in advance,
Chris
At the moment all it gives me is a "CGI ERROR The specified CGI application misbehaved by not returning a complete set of HTTP headers."
!/usr/bin/perl
use OLE;
use CGI;
$jmail = CreateObject OLE "JMail.SMTPMail";
$form = new CGI;
$Recipient="genuine@address.co.uk";
$name=$form->param('name');
$fromEmail=$form->param('fromEmail');
$PreBody=$form->param('body');
$Body=$PreBody."\n\n".$name;
$domain = $ENV {'SERVER_NAME'};
$referer = $ENV {'HTTP_REFERER'};
$url = $referer;
$url =~ s/^http:\/\///i;
$url =~ s/^$domain =~ s/^
$Sender = "$fromEmail";
$SMTPServer = "smtp.$domain:25";
$Subject = "Crispini Website Feedback";
$Priority=3;
$Header = "Originating-IP", $ENV{'REMOTE_ADDR'};
$jmail->{ServerAddress} = $SMTPServer;
$jmail->{Sender} = $Sender;
$jmail->{Subject} = $Subject;
$jmail->AddRecipient ($Recipient);
$jmail->{Body} = $Body;
$jmail->{Priority} = $Priority;
$jmail->AddHeader ($Header);
if ($url =~ m/^$domain/)
{
$mailmessage = "mail sent";
$jmail->Execute;
}
else
{
print "Content-type: text/html\n\n";
$mailmessage = "mail was not sent. Incorrect Referer";
}
print "location:
I have basically copied and pasted this script as I'm not a PERL programmer (Thankfully ; )
Thanks in advance,
Chris