I'm trying to get an email generated when a form is processed. This is my first stab at such. It's not working for some reason. When I comment out the lines concerning the email generation, it works fine. The problem apparently lies somewhere in that section of the code, but I'm not sure just what the issue is.
#!/usr/bin/perl
#trialSubscription.cgi
print "Content-type: text/html\n\n";
use CGI qw(:standard);
use Mail::Sendmail;
use strict;
#var declarations
my ($firstName, $lastName, $email, $street, $city, $state, $zip, $msg, %mail);
#var values
$firstName = param('firstName');
$lastName = param('lastName');
$email = param('email');
$street = param('street');
$city = param('city');
$state = param('state');
$zip = param('zip');
#create message to email
$msg = "$firstName $lastName would like to subscribe to a free 6 month trial of SGN Scoops. His/her email address is $email. \n";
$msg = $msg . "The physical address is $street in $city, $state $zip.";
#create page
print <<endHtml;
<html>
<head>
<title>Thank you for subscribing</title>
<body>
<p> </p>
<p> </p>
<p> </p>
<p align="center" /><font size="4" face="Arial">Thank you for subscribing, $firstName.<br />
Click <a href="index.html">here</a> to return to the SGN Scoops main page.</font></p>
</body>
</html>
endHtml
#send email
$mail{To} = 'kahaj@yahoo.com';
$mail{From} = $email;
$mail{Subject} = 'Trial Subscription Request';
$mail{Smtp} = 'mail.sgnscoops.com';
$mail{Message} = $msg;
sendmail(%mail);