Log problem - Fatal error... enable

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
cybercog
Forum Newbie
Posts: 20
Joined: Sat Oct 06, 2007 10:35 pm

Log problem - Fatal error... enable

Post by cybercog »

Hello,

I'm getting this:
Fatal error: Call to a member function enable() on a non-object in /home/dstefani/public_html/mailer3.php on line 7

Here is the code:

Code: Select all

require_once "swift_lib/Swift.php";
require_once "swift_lib/Swift/Connection/SMTP.php";
$swift = new Swift(new Swift_Connection_SMTP("mail.fakesitename.com"));
$swift->log->enable();
It dies here at line 7 no matter what comes next.

Thanks,

- Don
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

The API changed in version 3.3.

Code: Select all

$log = Swift_LogContainer::getLog();
$log->setLogLevel(4); //4 is highest, 0 is off
Post Reply