0

I am having this error using SwiftMailer Libs.

$message_body = "Body of message";

$transport = send_mail_transport();

//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);

//Create the message
$message = Swift_Message::newInstance();


  $message->setBody('$message_body'); //displays $message_body in mail client
  $message->setBody($message_body); //throws parse error in browser
  $message->setBody('Body of message'); //Works well. displays Body of message in mail client

//What could be the problem as i intent to get values from variables?

Thanks

4

1 に答える 1

0

Ok. Figured it out Changed it to

$message->setBody("$message_body");

Interestingly this was not documented in their manual.

于 2011-07-17T17:25:39.617 に答える