Page 1 of 1

class Swift_Message not found in SwiftMailer 4.0.0?

Posted: Mon Mar 09, 2009 10:47 am
by HHahn
I cannot believe I am the first one using 4.0.0...

Anyway, the line

Code: Select all

$message = Swift_Message::newInstance();
produces a fatal PHP error "Call to undefined method Swift_Message::newinstance()".

With a text find operation on the files, this class turns out to be declared in lib/Swift/Message.php. But including this file does not remedy the problem.

I note that the example files include a file named "swift_required.php" instead of "Swift.php", but I cannot find that file.

What is wrong?

Re: class Swift_Message not found in SwiftMailer 4.0.0?

Posted: Mon Mar 09, 2009 10:58 am
by xdecock
swift_required start the autoloader used to load the needed files for finding automaticaly the good files.

can you give a commplete code? (with include & so on) so that we can reproduce this?

thanks

Re: class Swift_Message not found in SwiftMailer 4.0.0?

Posted: Mon Mar 09, 2009 11:27 am
by HHahn
xdecock wrote:swift_required start the autoloader used to load the needed files for finding automaticaly the good files.
can you give a commplete code? (with include & so on) so that we can reproduce this?
Well, uhh, I now see what happened. I removed version 3 from the server, and then uploaded ..., yes, version 3. Rather stupid.
I now uploaded the real version 4, and I am now getting a lot further.
Thanks anyway.