Gorris Posted February 11, 2014 Share Posted February 11, 2014 I am having problems solving a problem on a website that I currently took over. The above error is displayed on the contact form as well as the e-mailer. The code is below: $transport = Swift_SmtpTransport::newInstance($smtpServer, $smtpPort) ->setUsername($mailUsername) ->setPassword($mailPassword); $mailer = Swift_Mailer::newInstance($transport); // Create the message $message = Swift_Message::newInstance() // Give the message a subject ->setSubject($title) // Set the From address with an associative array ->setFrom(array($mailFromAddress => $mailFromName)) // Set the To addresses with an associative array ->setTo(array($email => $name)) // Give it a body ->setBody($description, 'text/html') ->addPart($description, 'text/plain') ->setReturnPath($returnEmail) I just started coding in php so I'm not quite sure what needs to be done. Searching google.com has brought no resolve. Any information would be greatly appreciated. Thank you ahead of time. Quote Link to comment https://forums.phpfreaks.com/topic/286112-parse-error-syntax-error-unexpected-t_object_-operator/ Share on other sites More sharing options...
jazzman1 Posted February 11, 2014 Share Posted February 11, 2014 Take some good php IDE and you'll find problems like this less than 10 sec. Quote Link to comment https://forums.phpfreaks.com/topic/286112-parse-error-syntax-error-unexpected-t_object_-operator/#findComment-1468501 Share on other sites More sharing options...
Gorris Posted February 11, 2014 Author Share Posted February 11, 2014 Is there a certain one that I should be using? Currently writing code in notepad ++. Thanks for the help by the way. Quote Link to comment https://forums.phpfreaks.com/topic/286112-parse-error-syntax-error-unexpected-t_object_-operator/#findComment-1468504 Share on other sites More sharing options...
jazzman1 Posted February 11, 2014 Share Posted February 11, 2014 As far as I know notepad++ is not an IDE it's a text/code editor. My personal choice is NetBeans. Quote Link to comment https://forums.phpfreaks.com/topic/286112-parse-error-syntax-error-unexpected-t_object_-operator/#findComment-1468505 Share on other sites More sharing options...
Gorris Posted February 11, 2014 Author Share Posted February 11, 2014 Yeah, I knew notepad ++ was just a text editor. I downloaded NetBeans and will see if I can figure out the problem. Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/286112-parse-error-syntax-error-unexpected-t_object_-operator/#findComment-1468506 Share on other sites More sharing options...
Solution Gorris Posted February 11, 2014 Author Solution Share Posted February 11, 2014 I figured out my problem. The hosting server that I use was not set to PHP 5. Once I changed it to that instead of the default settings everything started working correctly. Quote Link to comment https://forums.phpfreaks.com/topic/286112-parse-error-syntax-error-unexpected-t_object_-operator/#findComment-1468523 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.