Monday, April 10, 2017

Laravel Mailing Error

Not long ago I started receiving this strange error with mail sending in my Laravel application, error is:

ErrorException in EsmtpTransport.php line 55:
Argument 1 passed to Swift_Transport_EsmtpTransport::__construct() must implement interface Swift_Transport_IoBuffer, none given

Interesting thing is that my mailing system worked just fine for about a year, nothing has been updated (just server and domain paid again few weeks back), so I presume that code isn't the problem, I double checked information in mail authentication system, those are right too.

I followed exception stack trace, and found that in Swift_SmtpTransport::__construct() parameters are sent right, but from there Swift_EsmtpTransport::__construct() is called without parameters (which is actually error shown)

Also I updated all my libraries (with "composer update" command). I have no idea what can be wrong, and couldn't find anything that helps online, so any help will be great

Current versions are:

  • "laravel/framework": "5.2.*" // from "composer.json"
  • "swiftmailer/swiftmailer": "~5.1" (v5.4.6 after update) // from "laravel/framework/composer.json"

--- Edit ---
I found somewhere that this is some kind of loading (Dependency Injection) problem, so I executed this line of code:

var_dump(Swift_DependencyContainer::getInstance()->createDependenciesFor('transport.smtp'));

And got this as result array(0) { }



via Acko

Advertisement