Cannot use server's SMTP in CP 2.0.0

A couple of days ago I thought I would try CP 2 on one of my sites. I deleted all the files and folders under public_html, dropped the database tables and uploaded CP 2 using FTP. I had set the site to use PHP 8.1

Everything appeared to work fine until I tried to install WP Mail SMTP. As usual, I set it to “Other” and used the server’s login details. This resulted in an error 500.

So, I tried a couple of other SMTP plugins, but the same thing happened. Then I dropped the PHP down to 8.0, but the problem persisted.

As a last resort, I did a restore of the clean CP 2 installation I had made before adding any data or plugins. But it failed as soon as I tried to use SMTP.

Having spent around 12 hours before that, trying to get the free version of the GeneratePress theme to look like the paid version, I gave up and restored my original site.

Today, I thought I’d simply do a manual update on PHP 7.4 as suggested in the release notes. While the site worked, as soon as I went to the SMTP settings, I got the error 500 again. Of course, I expected that to happen.

So for some reason CP 2.0.0 is not letting me use my cPanel’s SMTP details. Here is the error file that was generated, if it helps anyone spot why. The other SMTP plugins generated very similar errors:

[09-Apr-2024 11:56:08 UTC] PHP Warning:  Use of undefined constant SODIUM_CRYPTO_SECRETBOX_NONCEBYTES - assumed 'SODIUM_CRYPTO_SECRETBOX_NONCEBYTES' (this will throw an Error in a future version of PHP) in /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Helpers/Crypto.php on line 132
[09-Apr-2024 11:56:08 UTC] PHP Warning:  Use of undefined constant SODIUM_CRYPTO_SECRETBOX_MACBYTES - assumed 'SODIUM_CRYPTO_SECRETBOX_MACBYTES' (this will throw an Error in a future version of PHP) in /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Helpers/Crypto.php on line 132
[09-Apr-2024 11:56:08 UTC] PHP Warning:  A non-numeric value encountered in /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Helpers/Crypto.php on line 132
[09-Apr-2024 11:56:08 UTC] PHP Warning:  A non-numeric value encountered in /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Helpers/Crypto.php on line 132
[09-Apr-2024 11:56:08 UTC] PHP Warning:  Use of undefined constant SODIUM_CRYPTO_SECRETBOX_NONCEBYTES - assumed 'SODIUM_CRYPTO_SECRETBOX_NONCEBYTES' (this will throw an Error in a future version of PHP) in /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Helpers/Crypto.php on line 137
[09-Apr-2024 11:56:08 UTC] PHP Warning:  mb_substr() expects parameter 3 to be int, string given in /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Helpers/Crypto.php on line 137
[09-Apr-2024 11:56:08 UTC] PHP Warning:  Use of undefined constant SODIUM_CRYPTO_SECRETBOX_NONCEBYTES - assumed 'SODIUM_CRYPTO_SECRETBOX_NONCEBYTES' (this will throw an Error in a future version of PHP) in /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Helpers/Crypto.php on line 138
[09-Apr-2024 11:56:08 UTC] PHP Warning:  mb_substr() expects parameter 2 to be int, string given in /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Helpers/Crypto.php on line 138
[09-Apr-2024 11:56:08 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function WPMailSMTP\Helpers\sodium_crypto_secretbox_open() in /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Helpers/Crypto.php:147
Stack trace:
#0 /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Options.php(326): WPMailSMTP\Helpers\Crypto::decrypt('aXCcCsxQ54qGYJk...')
#1 /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Options.php(286): WPMailSMTP\Options->get_existing_option_value('smtp', 'pass')
#2 /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Options.php(216): WPMailSMTP\Options->get('smtp', 'pass')
#3 /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Admin/Area.php(182): WPMailSMTP\Options->get_all()
#4 /home/xxxxxx/public_html/wp-includes/class-wp-hook.php(308): WPMailSMTP\Admin\Area->display_setup_notice('')
#5 /home/xxxxxx/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#6 /home/xxxxxx/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#7 /home in /home/xxxxxx/public_html/wp-content/plugins/wp-mail-smtp/src/Helpers/Crypto.php on line 147 

Azurecurve’s SMTP works well for me in ClassicPress 2.

1 Like

Thanks Simone, it worked a treat.

Now I’ll have to try to remember how I configured GeneratePress! My aim was to create a starter theme for CP using the free version.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.