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 = "a@a.com";
$mail->Password = "password";

$mail->From = "a@a.com";
$mail->FromName = "Our company";
$mail->AddAddress("to@yahoo.com");

$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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.