Class 'PHPMailer\PHPMailer\PHPMailer' not found in Drupal\mailjet\Plugin\Mail\MailjetMail->mail()

Created on 28 March 2023, over 1 year ago
Updated 31 March 2023, over 1 year ago

Problem/Motivation

Class 'PHPMailer\PHPMailer\PHPMailer' not found in Drupal\mailjet\Plugin\Mail\MailjetMail->mail() (line 169 of /mysite/html/modules/contrib/mailjet/src/Plugin/Mail/MailjetMail.php)

#0 /mysite/html/modules/contrib/mailsystem/src/Adapter.php(50): Drupal\mailjet\Plugin\Mail\MailjetMail->mail()

Steps to reproduce

I added a person on /admin/people
I clicked to add and got a WSOD

Is this what is needed?
src/Plugin/Mail/MailjetMail.php:14:use PHPMailer\PHPMailer\PHPMailer;

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Postponed: needs info

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States SocialNicheGuru

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @SocialNicheGuru
  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

    The older versions was requiring manual installation of PHPMailer. The 3.0.x-dev already includes the requirement in composer.json so it would be installed automatically.

    SocialNicheGuru, can you please confirm how did you install the module?

  • Status changed to Active over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States SocialNicheGuru

    Yes I added it via composer, "drupal/mailjet":"3.0.x-dev@dev",

    message:
    - Installing drupal/mailjet (dev-3.0.x 68b900f): Cloning 68b900f5d4 from cache

    The website encountered an unexpected error. Please try again later.
    Error: Class 'PHPMailer\PHPMailer\PHPMailer' not found in Drupal\mailjet\Plugin\Mail\MailjetMail->mail() (line 169 of modules/contrib/mailjet/src/Plugin/Mail/MailjetMail.php).
    Drupal\mailjet\Plugin\Mail\MailjetMail->mail() (Line: 50)
    Drupal\mailsystem\Adapter->mail() (Line: 307)
    Drupal\Core\Mail\MailManager->doMail() (Line: 180)
    Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}() (Line: 564)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 181)
    Drupal\Core\Mail\MailManager->mail() (Line: 70)
    Drupal\mailsystem\MailsystemManager->mail() (Line: 1070)
    _user_mail_notify() (Line: 128)
    Drupal\user\RegisterForm->save()
    call_user_func_array() (Line: 114)
    Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 52)
    Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 592)
    Drupal\Core\Form\FormBuilder->processForm() (Line: 320)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
    Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 54)
    Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle() (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 43)
    Drupal\webform_product\RedirectMiddleware->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
    Stack\StackedHttpKernel->handle() (Line: 719)
    Drupal\Core\DrupalKernel->handle() (Line: 19)

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

    Hi SocialNicheGuru, can you please check the following?

    1. What is the phpmailer/phpmailer version you have installed?
    lando composer show phpmailer/phpmailer
    2. Make sure your composer autoloader is up to date; the easiest way to do that is to remove the vendor directory and run composer install.
    3. In some rare cases, PHP interpreter opcache may be out of date. Try restarting your PHP process.

  • Status changed to Active over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States SocialNicheGuru

    composer show phpmailer/phpmailer
    name : phpmailer/phpmailer
    descrip. :
    keywords :
    versions : * 6.0.7
    type : drupal-library
    homepage :
    source : []
    dist : [zip] https://github.com/phpmailer/phpmailer/archive/refs/tags/v6.0.7.zip
    path : /mypath/html/libraries/phpmailer
    names : phpmailer/phpmailer

    html/libraries/phpmailer$ ls
    COMMITMENT get_oauth_token.php LICENSE SECURITY.md VERSION
    composer.json language README.md src

    My php version is 7.4+

    Is this a specific php8.0 syntax that is throwing an error?

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

    It seems like the library is installed at the wrong path; now sure how that's possible but it's in libraries/phpmailer while it should be at vendor like any normal PHP library.

Production build 0.71.5 2024