SwiftMailer error Undefined property: Swift_Transport_StreamBuffer::$_sequence

Osh Mansor picture Osh Mansor · Sep 24, 2014 · Viewed 8.4k times · Source

I'm using SwiftMailer to send email by SMTP. The library is working fine when running in the server with PHP version 5.4. However, after upgrading the server to PHP version 5.5, email was not sent and the server threw the following error:

Undefined property: Swift_Transport_StreamBuffer::$_sequence

How can I resolve this issue? Thanks.

Answer

hakre picture hakre · Sep 26, 2014

In swift-mailer/classes/Swift/ByteStream/AbstractFilterableInputStream.php change

 private $_sequence = 0;

to

 protected $_sequence = 0;

Then the message goes away.

I must use a different version of Swiftmailer than you in the legacy project I got the exact same error notice. My Swift::VERSION is 4.1.1.