I have the following structure of folders in Zend Framework:
Application
- default
-- controllers
--- mailController.php
- modules
-- asegurados
--- controllers
---- indexController.php
I have an action in mailController which sends a mail (sendmailAction), and I want to send the exact mail in indexController in a function called sendmailAction. How can I call from IndexController::sendmailAction() to MailController::sendmailAction()?
I've tried the following:
/** indexController.php **/
public function sendformatosAction() {
...
$M = new MailController();
$M->sendmailAction();
...
}
But it seems that it's not loading the proper class. Can you help me, please? thanks!!