• Resolved nzsimonyoung

    (@nzsimonyoung)


    I have installed the WP mail plugin and set it up for smtp mail, but when i use the mail test function I get an error 500 page.

    Server version details
    Wordpress 4.9.5
    WP Mail SMTP 1.6.0
    Ubuntu 18.04.3 LTS
    PHP Version 7.2.19
    Apache/2.4.29

    this is my error log file details
    [Fri Aug 30 02:04:34.640225 2019] [php7:error] [pid 20086] [client xxx.xxx.xxx.xxx:50775] PHP Fatal error: Uncaught Error: Class ‘SMTP’ not found in /usr/share/php/libphp-phpmailer/class.phpmailer.php:1495\nStack trace:\n#0 /usr/share/php/libphp-phpmailer/class.phpmailer.php(1578): PHPMailer->getSMTPInstance()\n#1 /usr/share/php/libphp-phpmailer/class.phpmailer.php(1515): PHPMailer->smtpConnect(Array)\n#2 /usr/share/php/libphp-phpmailer/class.phpmailer.php(1301): PHPMailer->smtpSend(‘Date: Fri, 30 A…’, ‘\\t\\t<!doctype htm…’)\n#3 /usr/share/wordpress/wp-content/plugins/wp-mail-smtp/src/MailCatcher.php(88): PHPMailer->postSend()\n#4 /usr/share/wordpress/wp-includes/pluggable.php(478): WPMailSMTP\\MailCatcher->send()\n#5 /usr/share/wordpress/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/TestTab.php(167): wp_mail(Array, ‘WP Mail SMTP: H…’, ‘\\t\\t<!doctype htm…’, Array)\n#6 /usr/share/wordpress/wp-content/plugins/wp-mail-smtp/src/Admin/Area.php(668): WPMailSMTP\\Admin\\Pages\\TestTab->process_post(Array)\n#7 /usr/share/wordpress/wp-includes/class-wp-hook.php(286): WPMailSMTP\\Admin\\Area->process_actions(”)\n#8 /usr/share/wor in /usr/share/php/libphp-phpmailer/class.phpmailer.php on line 1495, referer: http://xxxxxx/wordpress/wp-admin/admin.php?page=wp-mail-smtp&tab=test

    Sorry if you have already supplied an answer, but I have searched the forum and none of the answers fix my issue

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Slava Abakumov

    (@slaffik)

    Hi @nzsimonyoung,

    For some reason, your WP installation uses the global phpmailer class installed on your server (in /usr/share/php/libphp-phpmailer/class.phpmailer.php), and not the one provided by WordPress.
    The one distributed with WordPress is modified a bit and loads the SMTP class from within the WP code base.

    Please remove libphp-phpmailer package from your Ubuntu (Debian or whatever) installation – this should fix the issue.

    Thread Starter nzsimonyoung

    (@nzsimonyoung)

    Hi Slava,

    when I first installed your plugin it wouldn’t work same error (class not found), and the /usr/share/php/libphp-phpmailer/ was already there, I’m assuming installed as part of the build process. But thinking the problem was that Phpmailer wasn’t installed, i ran the installer for that. But the problem didn’t go away. And thats when I posted the question on here.

    So if I rename the libphp-phpmailer folder, it breaks my whole wordpress and I can’t log on at all and log file shows
    PHP Warning: require_once(/usr/share/php/libphp-phpmailer/class.phpmailer.php)

    using my backup I rolled the server back to before I installed phpmailer, but I’m still having the same error.

    Uncaught Error: Class ‘SMTP’ not found in /usr/share/php/libphp-phpmailer/class.phpmailer.php

    so not sure how to get WP to use the modified code you mention

    Regards
    Simon

    Thread Starter nzsimonyoung

    (@nzsimonyoung)

    Hi Slava,

    I gave up, and started again from a fresh VM and reinstalled everything, And WP Mail works fine this time

    Regards
    Simon

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

The topic ‘Error: Class ‘SMTP’ not found’ is closed to new replies.