PHP SMTP send mail error
Posted: Tue Jan 09, 2007 11:43 am
code:
Error displayed on the page:
Parse error: syntax error, unexpected T_VARIABLE in /home/thesmi6/public_html/form/phpmailer/phpmailer/mail.php on line 2
Could someone tell me why I am getting this error?
Code: Select all
<?php
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "localhost"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "webmaster@thesmileshack.com"; // SMTP username
$mail->Password = "******"; // SMTP password
$mail->From = "webmaster@thesmileshack.com";
$mail->FromName = "Mailer";
$mail->AddAddress("charles@midohioit.com","Josh Adams");
$mail->AddAddress("chadamywilson@alltel.net","test"); // optional name
$mail->AddReplyTo("info@site.com","Information");
$mail->WordWrap = 50; // set word wrap
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the <b>HTML body</b>";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>Parse error: syntax error, unexpected T_VARIABLE in /home/thesmi6/public_html/form/phpmailer/phpmailer/mail.php on line 2
Could someone tell me why I am getting this error?