Why are you using POSTDATA? Here is unclunky version
#!/usr/bin/perlml --
##
##
##
## perltidy -olq -csc -csci=3 -cscl="sub : BEGIN END " -otr -opr -ce
+-nibc -i=4 -pt=0 "-nsak=*"
## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -opr
+-ce -nibc -i=4 -pt=0 "-nsak=*"
## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if while " -otr
+ -opr -ce -nibc -i=4 -pt=0 "-nsak=*"
#!/usr/bin/perl --
use strict;
use warnings;
use CGI ();
use CGI::Carp qw( fatalsToBrowser );
use Mail::Sendmail qw/ sendmail /;
Main( @ARGV );
exit( 0 );
sub Main {
my $q = CGI->new;
## NONSENSE
## my @values = split /[\s=]+/, $q->param('POSTDATA');
#~ Send( split /[\s=]+/, $q->param('POSTDATA') );
Send( $q );
return print Thanks( $q );
}
sub Send {
my( $q ) = @_;
my $from = $q->param( 'from' );
my $msg = $q->param( 'msg' );
my %mail = (
'smtp' => "smtp.###.co.za",
'port' => 465,
'auth' => { user => '###@###.co.za', password => '###' },
To => '###@###.co.za',
From => $from,
Message => $msg,
);
sendmail( %mail ) or die $Mail::Sendmail::error;
} ## end sub Send
sub Thanks {
return $cgi->header, <<END;
<html>
<head>
<title>Thank you for your message</title>
<meta http-equiv="Content-Type" content="text/html; c
+harset=utf-8" />
<meta http-equiv="Content-Language" content="en" />
<link rel="stylesheet" type="text/css" href="/css/gen
+eral.css" />
<link rel="stylesheet" type="text/css" href="/css/tha
+nks.css" />
</head>
<body>
<div id="header">
<img id="small-logo" alt="### Logo" src="/graphic
+s/LogoSmall.jpg" height="80" width="80" />
<div id="nav">
<ul>
<li><a href="/index.html">home</a></li>
<li><a href="/about.html">about us</a></l
+i>
<li><a href="/products.html">products</a>
+</li>
<li><a href="/customers.html">customers</
+a></li>
<li><a href="/gallery.html">gallery</a></
+li>
<li><a href="/contact.html">contact us</a
+></li>
</ul>
</div>
</div>
<div id="content">
<h1>Thank you for leaving a message</h1>
<p>We will respond as soon as possible.</p>
</div>
</body>
</html>
END
} ## end sub Thanks
__END__