Jump to content

Parse error: syntax error, unexpected T_OBJECT_ Operator


Gorris
Go to solution Solved by Gorris,

Recommended Posts

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.

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.