Jump to content

[SOLVED] PHP SMTP send mail error


simple_man_11

Recommended Posts

[b]code:[/b]

<? php
$mail = new PHPMailer();

$mail->IsSMTP();                                  // send via SMTP
$mail->Host    = "localhost"; // SMTP servers
$mail->SMTPAuth = true;    // turn on SMTP authentication
$mail->Username = "[email protected]";  // SMTP username
$mail->Password = "******"; // SMTP password

$mail->From    = "[email protected]";
$mail->FromName = "Mailer";
$mail->AddAddress("[email protected]","Josh Adams");
$mail->AddAddress("[email protected]","test");              // optional name
$mail->AddReplyTo("[email protected]","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";

?>

[b]Error displayed on the page:[/b]

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?
Link to comment
https://forums.phpfreaks.com/topic/33490-solved-php-smtp-send-mail-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.