leony Posted August 9, 2008 Share Posted August 9, 2008 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. Quote Link to comment Share on other sites More sharing options...
CaptainChainsaw Posted August 9, 2008 Share Posted August 9, 2008 Have you tried removing all your code except the class instantiation to make sure it's definitely not your code that's causing the problem? Quote Link to comment Share on other sites More sharing options...
leony Posted August 9, 2008 Author Share Posted August 9, 2008 Sorry, it is my mistake.1and1 is running PHP4 but I tired the PHP MAILER 5. Thank you for your reply. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.