Getting a Fatal Error using swift
Posted: Thu Apr 23, 2009 12:10 am
Hi,
I am trying to use the swift 4 class for sending
email.
Here is my script:
I get this error:
Please help
I am trying to use the swift 4 class for sending
email.
Here is my script:
Code: Select all
<?php
/*
* news_send.php
*/
Swift_Message::newInstance();
// set the sender
$message->setFrom(array('Editor@expert-world.com' => 'James Burke'));
// set the recipient
$message->setTo(array('$email' => '$contact'));
// set the subject
$message->setSubject('$subject');
// set the html body
$message->setBody('$message', 'text/html');
// set the text body
$message->addPart('$message_text', 'text/plain');
//Send the message
if (!$mailer->send($message, $failures)) {
echo "<div class=\"ctrl_lister\">
<span class= \"lk\">$Rctr ) Failed to Send Edn 1 to :$user_id, at $failures</span>
</div>";
} // end if
else {
// update database
$sql = "UPDATE clients SET eml = eml+1 WHERE user_id = '$user_id'";
mysql_query($sql) or die("could not execute adverts update query". mysql_error());
echo "<div class=\"ctrl_lister\">
<span class= \"lk\">$Rctr ) Sent Edn 1 to :$user_id, Type: $type, Contact: $contact, Joined:$join_dt</span>
</div>";
} // end else
$Rctr = $Rctr +1;
/*
* end of news_send.php
*/
?>Line line is: $message->setFrom(array('Editor@expert-world.com' => 'James Burke'));Fatal error: Call to a member function setFrom() on a non-object in /home/guru54gt5/public_html/im/news_send.php on line 9
Please help