simple_man_11 Posted January 9, 2007 Share Posted January 9, 2007 [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 2Could 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.