We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10378
    • 375 Posts
    All of a sudden I get the following error message in MODx log:

    Could not load class: modError from error.mysql.moderror

    The error seems to be produced while calling the send method of the modPHPMailer class.

    $sent = $this->modx->mail->send();


    The mail is sent correctly but the script crashes somewhere inside this method chain.

    The problem is, I didn't change anything in this code. but I think I did read PHP Mailer was updated in one of the last Revo updates?

    I have no clue what to do to fix this, so your help is appreciated!

    This question has been answered by markh. See the first response.

      Freelancer @bitego http://www.bitego.com
      ---
      GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
      More infos here: http://www.bitego.com/extras/goodnews/
    • discuss.answer
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Loading MODX externally by chance, i.e. via a connector, cron or something similar? If so, make sure you load the modError class when initialising the modX instance. From the docs, the last line:

      require_once '/absolute/path/to/modx/config.core.php';
      require_once MODX_CORE_PATH.'model/modx/modx.class.php';
      $modx = new modX();
      $modx->initialize('web');
      $modx->getService('error','error.modError', '', '');
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 10378
        • 375 Posts
        Mark, thanks a lot! (again) - I now works!
        Indeed I do load MODX externally by cron.

        What's strange is the fact, that this worked without any problems until one of the last MODX updates.
        What changed that this error is popping up now? Could the updated PHP Mailer be the reason? Or a change in the MODX error handling?
          Freelancer @bitego http://www.bitego.com
          ---
          GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
          More infos here: http://www.bitego.com/extras/goodnews/