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.
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.