class Swift_Message not found in SwiftMailer 4.0.0?

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
HHahn
Forum Commoner
Posts: 43
Joined: Mon Mar 02, 2009 9:16 am
Location: Veldhoven, Netherlands

class Swift_Message not found in SwiftMailer 4.0.0?

Post 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?
xdecock
Forum Commoner
Posts: 37
Joined: Tue Mar 18, 2008 8:16 am

Re: class Swift_Message not found in SwiftMailer 4.0.0?

Post 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
HHahn
Forum Commoner
Posts: 43
Joined: Mon Mar 02, 2009 9:16 am
Location: Veldhoven, Netherlands

Re: class Swift_Message not found in SwiftMailer 4.0.0?

Post 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.
Post Reply