v. 4.0.3 error Swift_MailTransport

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
synthetic2
Forum Newbie
Posts: 2
Joined: Thu Apr 23, 2009 6:56 am

v. 4.0.3 error Swift_MailTransport

Post 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!
synthetic2
Forum Newbie
Posts: 2
Joined: Thu Apr 23, 2009 6:56 am

Re: v. 4.0.3 error Swift_MailTransport

Post by synthetic2 »

any idias? )
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: v. 4.0.3 error Swift_MailTransport

Post 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)
kindrosker
Forum Newbie
Posts: 2
Joined: Mon May 04, 2009 4:01 pm

Re: v. 4.0.3 error Swift_MailTransport

Post 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);
kindrosker
Forum Newbie
Posts: 2
Joined: Mon May 04, 2009 4:01 pm

Re: v. 4.0.3 error Swift_MailTransport

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