1

I am working with Joomla 4.2.2

I have a custom script which i previously used in Joomla 3.*, from this i am sending mail using send-mail.

For front it's working fine but on admin side it can not detect the current application (Admin Application) and it gives me the error -> Failed to start application. enter image description here

Exception
Exception:
Failed to start application

  at /html/joomla/libraries/src/Factory.php:140
  at Joomla\CMS\Factory::getApplication()
     (/html/joomla/libraries/src/Mail/Mail.php:503)
  at Joomla\CMS\Mail\Mail->isSendmail()
     (/html/joomla/libraries/src/Factory.php:682)
  at Joomla\CMS\Factory::createMailer()
     (/html/joomla/libraries/src/Factory.php:439)
  at Joomla\CMS\Factory::getMailer()
     (/html/joomla/administrator/invoiceCopy.php:698)  

How i can set application globally as admin application while i use the admin environment.

1
  • 1
    In Joomla 4 the application could be get via $this->app but in only works at controller level. You can check how it's done by viewing contact controller at '/components/com_contact/src/Controller/ContactController.php', _sendEmail function.
    – Elboyler
    Commented Oct 20, 2022 at 13:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.