getOption('emailsender'); $modx->getService('mail', 'mail.modPHPMailer'); $modx->mail->address('to', $to); $modx->mail->set(modMail::MAIL_FROM, $from); $modx->mail->set(modMail::MAIL_FROM_NAME, 'Console'); $modx->mail->set(modMail::MAIL_SUBJECT, $theme); $modx->mail->set(modMail::MAIL_BODY, $body); $modx->mail->setHTML(true); if (!$modx->mail->send()) { echo 'Sending failed. Error: ' . $modx->mail->mailer->ErrorInfo; } else { echo 'Success'; } $modx->mail->reset();
Проверка mail функции из console
MODX Revolution
21-09-2023
Запустить в консоли код: