Jump to content

[SOLVED] PHP Mailer error


leony

Recommended Posts

Hi,

 

I am trying to use PHP mailer but have a weird problem.

 

<?PHP

require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp(1and1 server)"; // SMTP server
$mail->SMTPAuth = TRUE;
$mail->Username = "[email protected]";
$mail->Password = "password";

$mail->From = "[email protected]";
$mail->FromName = "Our company";
$mail->AddAddress("[email protected]");

$mail->Subject = "First PHPMailer Message";
$mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->WordWrap = 50;

if(!$mail->Send())
{
   echo 'Message was not sent.';
   echo 'Mailer error: ' . $mail->ErrorInfo;
}
else
{
   echo 'Message has been sent.';
}


?>

The following files are in the same directory with the above code:

phpmailer.lang-en.php

class.phpmailer.php

 

And when I call the page, I get the following error:

 

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homepages/21/d130682581/htdocs/page/class.phpmailer.php on line 45

  public $Priority          = 3;

According to the dreamweaver, this is the line 45 in class.phpmailer.php

 

I have not modified anything in this file btw.

Link to comment
https://forums.phpfreaks.com/topic/118949-solved-php-mailer-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.