Page 1 of 1
v. 4.0.3 error Swift_MailTransport
Posted: Thu Apr 23, 2009 7:00 am
by synthetic2
my code:
Code: Select all
try
{
$transport = Swift_MailTransport::newInstance();
}
catch (Exception $e)
{
}
Catchable fatal error: Argument 1 passed to Swift_Transport_MailTransport::__construct() must be an instance of Swift_Transport_MailInvoker, none given in ..\classes\Swift\Transport\MailTransport.php on line 57
please help!
Re: v. 4.0.3 error Swift_MailTransport
Posted: Fri Apr 24, 2009 7:42 am
by synthetic2
any idias? )
Re: v. 4.0.3 error Swift_MailTransport
Posted: Fri Apr 24, 2009 11:09 am
by Chris Corbyn
synthetic2 wrote:any idias? )
Running PHP5 with zend.ze1_compatibility_mode on in php.ini?
EDIT | To explain further, this INI setting is a flag to make PHP5 behaviour more like PHP4, and it breaks Swift Mailer (and probably many other PHP5 libraries)
Re: v. 4.0.3 error Swift_MailTransport
Posted: Mon May 04, 2009 4:06 pm
by kindrosker
Chris Corbyn wrote:synthetic2 wrote:any idias? )
Running PHP5 with zend.ze1_compatibility_mode on in php.ini?
EDIT | To explain further, this INI setting is a flag to make PHP5 behaviour more like PHP4, and it breaks Swift Mailer (and probably many other PHP5 libraries)
I have the same problem and zend.ze1_compatibility_mode = Off
I'm trying to use swift in symfony-project.org and 3.x version works well
but if I try 4.0.3 I got the same error
php: 5.2.4
any ideas?
code example what I tried to run
Code: Select all
//Create the Transport
$transport = Swift_MailTransport::newInstance();
//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
Re: v. 4.0.3 error Swift_MailTransport
Posted: Mon May 04, 2009 5:37 pm
by kindrosker
I worked out with my problem, just need to add
Code: Select all
require_once sfConfig::get('sf_lib_dir').'/vendor/swift_init.php';
symfony automatically doesn't include swift like it was for 3 version...