Cannot add the Phalcon mailer and use it in the project. Doing same as instructions say. I have config linking to 'libraryDir' => APP_PATH . '/app/lib/'
, in the lib
folder I have a Mailer
folder where I put the composer.json
.
I followed THIS but after using the lib
in the Controller I've got
Fatal error: Uncaught Error: Class 'Phalcon\Ext\Mailer\Manager'
Code :
use Phalcon\Http\Response;
use Phalcon\Mvc\Model\Criteria;
use Phalcon\Mvc\Model\Query\BuilderInterface;
use Phalcon\Di\InjectionAwareInterface;
use Phalcon\Mvc\Model\Resultset; use Phalcon\Ext\Mailer\Manager;
use Phalcon\Ext\Mailer\Message;
class EmailController extends Phalcon\Mvc\Controller {
public function initialize() {
if ($this->request->isPost()) {
$this->view->disable();
}
}
public function indexAction() {
}
public function sendEmailAction(){
if ($this->request->isPost()) {
$config = [
'driver' => 'mail',
'from' => [
'email' => 'manager@email.com',
'name' => 'Email'
]
];
$email = new Phalcon\Ext\Mailer\Message($config);
return "send";
}
}
}