I have just put this code into a .pl file that is supposed to allow users to sign up and upon doing so send an email. Everything works fine except when I put the code to do the emailing in I get an error saying:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
My code is as follows: (any help or leads would be appriciated)
<?php
require("class.phpmailer.php");
require("class.smtp.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "mail.server.com"; // specify main server
$mail->SMTPAuth = true // turn on SMTP authentication
$mail->Username = "test" // SMTP username
$mail->Password = "test" // SMTP password
$mail->From = "$from";
$mail->FromName = "Brent";
$mail->AddAddress($emailaddress);
$mail->AddReplyTo("info@example.com", "Information");
$mail->Bcc($notify_email);
$mail->Subject = "Welcome";
$mail->Body = "This email finally worked! <b>in bold!</b>";
;$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>