• Resolved vincentdonker

    (@vincentdonker)


    Dear sir/madam,

    Since the last update, I get critical errors when trying to send e-mails via WP Mail SMTP.

    I use the most recent version of WordPress and WooCommerce. PHP Version 7.4. WP Mail SMTP is configured with Sendinblue.

    I tried the Action Scheduler plugin and WP-DBManager as suggested in https://www.ads-software.com/support/topic/there-has-been-a-critical-error-on-your-website-65/, this didn’t work.

    I set up WordPress Error Logs in WP-Config as per https://www.wpbeginner.com/wp-tutorials/how-to-set-up-wordpress-error-logs-in-wp-config/. However, no debug.log file appears in my wp-content folder.

    The following error displays when I am trying to send a test e-mail using WP Mail SMTP:

    Deprecated: class-phpmailer.php has been deprecated since version 5.5.0. Instead, use wp-includes / PHPMailer / PHPMailer.php. The PHPMailer class has been moved to wp-includes / PHPMailer subdirectory and now uses the PHPMailer \ PHPMailer namespace. in /mysite.com/public_html/wp-includes/functions.php on line 4963
    
    Deprecated: class-smtp.php has been deprecated since version 5.5.0. Instead, use wp-includes / PHPMailer / SMTP.php. The SMTP class has been moved to the wp-includes / PHPMailer subdirectory and now uses the PHPMailer \ PHPMailer namespace. in /mysite.com/public_html/wp-includes/functions.php on line 4963
    
    Fatal error: Cannot declare class PHPMailer \ PHPMailer \ SMTP, because the name is already in use in /mysite.com/public_html/wp-includes/PHPMailer/SMTP.php on line 30

    I don’t have enough knowledge of PHP, how can I resolve these errors?

    Thank you in advance for your help!

    Vincent

Viewing 12 replies - 16 through 27 (of 27 total)
  • Thread Starter vincentdonker

    (@vincentdonker)

    Furthermore, what I find strange is the following:

    – When I sent the “Processing-order” transactional e-mail via the Woocommerce backend, it returns the critical error.

    – When I sent the “Order completed” transactional e-mail via the Woocommerce backend, it works fine.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @vincentdonker,

    aha OK. Which WP theme are you using? It could be that the theme is changing the PHPMailer functionality and causing this issue.

    Where are you hosting your site?

    Could you please also check the wp-config.php file on your server? is there any mention of smpt or phpmailer in it? I’ve seen some hosting companies modify the PHPMailer functionality in that file before.

    The other thing that is worth checking is the “must-use” WP plugins. Do you have those set up on your WP site? Maybe the hosting set up some?

    Something has to require the PHPMailer and its SMTP file/class in order for this error to show up:
    Fatal error: Cannot declare class PHPMailer \ PHPMailer \ SMTP, because the name is already in use in /mysite.com/public_html/wp-includes/PHPMailer/SMTP.php on line 30

    Take care!

    Thread Starter vincentdonker

    (@vincentdonker)

    @capuderg

    Theme: Hestia Pro 3.0.4 (most recent version).
    Hosting: Versio (hosting provider in the Netherlands).

    There is no mentioning of either “smtp” or “phpmailer” in my wp-config.php file.

    There are no “must-use” plugins installed on the site.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @vincentdonker,

    hmmm… What could be causing this… I just retested on my hosting and local site, with the Sendinblue mailer, PHP 7.4 and I get no error, everything looks OK.

    Is it possible to switch to a default WP theme like Twenty Twenty and perform the email test with only WP Mail SMTP plugin activated?

    Just so we can also exclude the theme from being the issue…

    I would then suggest contacting the hosting company and asking them if they are modifying the WP install in any way, or if they are modifying/requiring the PHPMailer in the WP installation.

    Take care!

    Hi @capuderg,

    Here is the full error shown, (with debugging enabled in wp-config file):

    Deprecated: class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace. in /home/nzhiac5/public_html/wp-includes/functions.php on line 4963
    
    Deprecated: class-smtp.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/SMTP.php instead. The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace. in /home/nzhiac5/public_html/wp-includes/functions.php on line 4963
    
    Fatal error: Cannot declare class PHPMailer\PHPMailer\SMTP, because the name is already in use in /home/nzhiac5/public_html/wp-includes/PHPMailer/SMTP.php on line 30
    There has been a critical error on your website. Please check your site admin email inbox for instructions.

    No other plugins activated, no changes to Twenty Twenty theme, nothing changed in wp-config.php file.

    Hosting is with InMotion Hosting, they’re using Easy Apache 4, and as said its running PHP 7.4

    @capuderg, you were right, I found a must-use plugin that I hadn’t seen before: wpmail.php authored by Hoang Ngo. With that deleted, everything works perfectly for me! (Now I have to figure out who, when and how, that got added there!)
    – Thanks so much for your help, hopefully it’s something as simple for @vincentdonker too!

    • This reply was modified 4 years, 5 months ago by joshmyself.
    Thread Starter vincentdonker

    (@vincentdonker)

    @capuderg

    it looks like the WooCommerce – Sendinblue Add-on is causing the issue. They are requiring the old class-phpmailer.php and class-smtp.php files and that is causing the issue.

    You’re right, I tested again, the following plugins cause the issue when activated:
    – Newsletter, SMTP, Email marketing and Subscribe forms by Sendinblue 3.0.6
    – WooCommerce Sendinblue Newsletter Subscription 2.0.0

    I will contact Sendinblue.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @joshmyself and @vincentdonker,

    I’m really glad you found what was causing this issue. I was running out of ideas ??

    Have a great day!

    Hi @capuderg
    after my site updated to wordpress 5.5.0,when submiting registration form on https://www.biglabgo.com/register(I will set the “wp_debug” on for your test recently), it has the same problem with @vincentdonker.

    When wp-SMTP-mail actived, the website will breakdown and the debug as follows:

    Deprecated: class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace. in /home/nzhiac5/public_html/wp-includes/functions.php on line 4963
    
    Deprecated: class-smtp.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/SMTP.php instead. The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace. in /home/nzhiac5/public_html/wp-includes/functions.php on line 4963
    
    Fatal error: Cannot declare class PHPMailer\PHPMailer\SMTP, because the name is already in use in C:\Users\Administrator\Desktop\webs\biglabgo\wp-includes\PHPMailer\SMTP.php on line 30
    
    when wp-SMTP-mail deactived, the website will be normal but no emails sent and the debug just as follows(no Fatal error):
    

    Deprecated: class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace. in /home/nzhiac5/public_html/wp-includes/functions.php on line 4963

    Deprecated: class-smtp.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/SMTP.php instead. The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace. in /home/nzhiac5/public_html/wp-includes/functions.php on line 4963`

    And there is no problems in”mu-plugins” or “wp-config.php”or “functions.php”.How can I to do solve this error?
    if you have any process or questions ,please contact me by email [email protected] anytime.Look forward to your help and so thankful for your support!

    • This reply was modified 4 years, 5 months ago by ziseshiya.
    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @ziseshiya,

    the error occurs when our plugin is active, because our plugin calls the WordPress core PHPMailer\SMTP class and that triggers the error… Once you disable our plugin, the emails are no longer sent via SMTP, but are sent via PHP send functionality which does not call the PHPMailer\STMP class and so there is no error.

    Our plugin uses/calls the WordPress PHPMailer\SMTP class, but that does not mean, that our plugin is at fault… As in other cases most likely some other active plugin (or maybe multiple) are not compatible with WP 5.5 changes with PHPMailer classes and are causing these errors.

    Please deactivate all plugins except for the WP Mail SMTP and then try to send an email. If this works, then one (or more) of the disabled plugins is causing this issue. So you should enable one by one and make email sending tests in between to detect which plugin is at fault.

    Take care!

    Thank you @capuderg very much for your so so so quick reply! I am so sorry I checked carefully and found that our error is different, my error is:
    Fatal error: Cannot declare class PHPMailer\PHPMailer\SMTP, because the name is already in use in C:\Users\Administrator\Desktop\webs\biglabgo\wp-includes\PHPMailer\SMTP.php on line 30
    I thought it was a matter of repeating calls. I wonder if it still applies to the situation you analyzed???
    if the reason is the same, I will test every plugin according to your method. and if there is any result, I will give feedback here. Thank you very much!

    In addition, I wonder if WP-SMTP-mail can forcibly take over all the sending mail requests from other plugins, so as to solve all emali conflicts?

    • This reply was modified 4 years, 5 months ago by ziseshiya.
    • This reply was modified 4 years, 5 months ago by ziseshiya.
    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @ziseshiya,

    The error: Cannot declare class PHPMailer\PHPMailer\SMTP, because the name is already in use is the same as other users, so the cause is probably the same (a WP 5.5 incompatible plugin).

    Please try the plugin deactivation/activation method I posted above and let me know what you find.

    WordPress plugins should not do anything forcibly, since that would most probably result in several issues with other plugins and WP core itself. We try to prevent any issues that could occur from 3rd party plugins, but we can’t control if other plugins are not compatible with latest WordPress core changes.

    Have a nice day!

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘Critical Error’ is closed to new replies.