By this thread: https://forum.phalcon.io/discussion/9243/which-mailer-and-how-to-install, I set up $di like this:
$di->set('swiftmailer',function() use ($config) {
include 'path to swift_required.php';
$transport = Swift_SmtpTransport::newInstance($config->smtp->address,$config->smtp->port)
->setUsername($config->smtp->username)
->setPassword($config->smtp->password);
$mailer = Swift_Mailer::newInstance($transport);
return $mailer;
});
And then, How to send a mail in the Controllers?