New PHP8.2 error (Swift Mailer 5)

16 posts by 4 authors in: Forums > CMS Builder
Last Post: October 6, 2023   (RSS)

By Dave - March 2, 2023 - edited: March 2, 2023

Hi Zaba, 

Thanks for the report.  You can try hiding that deprecated error by adding a @ before strtolower as follows: 

/cmsb/3rdParty/SwiftMailer5/classes/Swift/Transport/Esmtp/AuthHandler.php (line 251)

        if (!$mode = @strtolower($this->_auth_mode ?? '')) {

Deprecated errors just mean the feature may be removed in the future.  

The mailer is due to be upgraded sometime soon, Symfony Mailer requires a lot of dependencies (many other libraries would need to be packaged with CMSB) and PHP 8.1 which everyone isn't on yet, but we're going to start looking into replacement options.  

Dave Edis - Senior Developer

By kitsguru - March 3, 2023 - edited: March 3, 2023

I am all for using symphony components. I already use some of them for my websites based on CMSB. 

I use YAML and TWIG components particularly.

Jeff Shields

By zaba - March 9, 2023

Still problems

Deprecated: Callables of the form ["Swift_Message", "Swift_Mime_SimpleMessage::__construct"] are deprecated in /XXXXXX/public_html/cmsb/3rdParty/SwiftMailer5/classes/Swift/Message.php on line 46 Deprecated: Callables of the form ["Swift_SmtpTransport", "Swift_Transport_EsmtpTransport::__construct"] are deprecated in /XXXXXX/public_html/cmsb/3rdParty/SwiftMailer5/classes/Swift/SmtpTransport.php on line 35 Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /XXXXXX/public_html/cmsb/3rdParty/SwiftMailer5/classes/Swift/Transport/EsmtpTransport.php on line 143 Warning: Cannot modify header information - headers already sent by (output started at /XXXXXX/public_html/cmsb/3rdParty/SwiftMailer5/classes/Swift/Message.php:46) in /XXXXXX/public_html/cmsb/lib/menus/header.php on line 4

By Dave - March 16, 2023 - edited: March 16, 2023

Hi Zaba,

We're just about to release the next version and I'll get these patched for that.  If you get any errors with the new version let me know.

Thank you!

Dave Edis - Senior Developer

By zaba - March 17, 2023

That's great Dave, I had to downgrade to PHP 7.4 as the job was about to go live. But I have many sites to upgrade in the coming months so will have the opportunity to test this very soon.

By Dave - March 17, 2023

Hi Zaba, 

Can you try the latest release and let me know if you find any other issues?  Thanks!

Dave Edis - Senior Developer

By zaba - March 22, 2023

Sorry Dave,

I have been up against it.

I have done a clean install of the latest release of CMSB 3_58_build2316 On PHP 8.2,

Added email credentials to "Email Settings" in CMSB and performed a Password Reset. 

I can confirm that no errors were reported and everything works perfectly!

Thanks again Dave

By Dave - March 22, 2023

Hi Zaba, 

Great, thanks for checking and following up!  If you run into any other issues just let us know.


Dave Edis - Senior Developer

By Djulia - March 30, 2023 - edited: March 30, 2023

Hi Dave,

I have this alert with PHP 8.2 (v3.58 (Build 2316) :

Callables of the form ["Swift_MailTransport", "Swift_Transport_MailTransport::__construct"] are deprecated
.../3rdParty/SwiftMailer5/classes/Swift/MailTransport.php (line 28)