Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Just in case anyone else has issues with this, I have resolved the issue on my end. Although I can only speculate on its cause. The class.phpmailer.php in the libphp-phpmailer package and the class-phpmailer.php inside the wp-includes folder were identical and both threw the error at this function:

    public function getSMTPInstance()
    {
    if (!is_object($this->smtp)) {
    $this->smtp = new SMTP;
    }
    return $this->smtp;
    }

    Upon looking up class-phpmailer.php on the official WordPress github I noticed there was a new line of code in the function.

    public function getSMTPInstance()
    {
    if (!is_object($this->smtp)) {
    require_once( ‘class-smtp.php’ ); <–
    $this->smtp = new SMTP;
    }
    return $this->smtp;
    }

    I have since added the line of code within my class.phpmailer.php inside my ibphp-phpmailer package and changed the name to class.smtp.php to match that within the package and my email test just succeed.

    Hey guys,

    I have a similar issue to those above. I am running WordPress 4.9.12 on a VM and the installation included a global libphp-phpmailer package.

    Has there been a better work around other than starting again with a fresh VM or a new WordPress install?

    My error is:
    PHP Fatal error: Uncaught Error: Class ‘SMTP’ not found in /usr/share/php/libphp-phpmailer/class.phpmailer.php:1495

    I followed Slava’s advice and attempted to remove the package with:
    sudo apt-get remove libphp-phpmailer

    However it the info after the command told me that WordPress would be removed also so I did not remove it.

    I renamed it and received this error:
    PHP Fatal error: require_once(): Failed opening required ‘/usr/share/php/libphp-phpmailer/class.phpmailer.php’ (include_path=’.:/usr/share/php’) in /usr/share/wordpress/wp-content/plugins/wp-mail-smtp/src/MailCatcher.php on line 7

    I then tracked down the specific line hoping to change the path to
    /usr/share/wordpress/wp-includes/class-phpmailer.php

    But received the same error (move down 2 lines with comments):
    Fatal error: require_once(): Failed opening required ‘/usr/share/wordpress/wp-includes/class-phpmailer.php’ (include_path=’.:/usr/share/php’) in /usr/share/wordpress/wp-content/plugins/wp-mail-smtp/src/MailCatcher.php on line 9

    Running on a Ubuntu 18.04 instance with ID_LIKE=debian

    Any work around would be very helpful,

    Thanks,

    Matt

Viewing 2 replies - 1 through 2 (of 2 total)