-1

I am getting the following errors, trying to setup my webform to use Swift Mailer on GoDaddy's cPanel, Linux hosting service.

What am I doing wrong?

Beginning at line 57, the code (emails hidden) is:

$mailer = Swift_Mailer::newInstance($transort);
$message = Swift_Message::newInstance('Web Inquiry')
->setFrom (array('email1@myemail.com' -> 'Web Inquiry'))
->setTo (array('email@email.com' -> 'Inquiry Recipients'))
->setBcc (array('email@email.com' -> 'Inquiry BCC Recipient, respond from email@email.com.net'))
->setSubject (array('Inquiry from email.com'))
->setBody (array($data, 'text/html'));
Martin R
  • 529,903
  • 94
  • 1,240
  • 1,382
Immobilus
  • 81
  • 1
  • 6

1 Answers1

1

Inside the array you want to use the => operator for pairing keys and values whereas for chaining object methods you are correctly using the -> operator

$mailer = Swift_Mailer::newInstance($transort);
$message = Swift_Message::newInstance('Web Inquiry')
->setFrom (array('email1@myemail.com' => 'Web Inquiry'))
->setTo (array('email@email.com' => 'Inquiry Recipients'))
->setBcc (array('email@email.com' => 'Inquiry BCC Recipient, respond from email@email.com.net'))
->setSubject (array('Inquiry from email.com'))
->setBody (array($data, 'text/html'));
Ryan Tuosto
  • 1,941
  • 15
  • 23