Slim 2.* and swiftmailer

I want to optimize the work with swiftmailer. Look it’s a good idea?


  require_once 'vendor/swiftmailer/swiftmailer/lib/swift_required.php';
  $transport = Swift_SmtpTransport::newInstance('host.com', 25);
  $mailer = Swift_Mailer::newInstance($transport);
  return $mailer;
};```

****

```$app->get("/send", function () use ($app,$database) {
      $mailer = $app->mailer;
      $html_body = 'News<br>'.htmlspecialchars($comment);
      $message = Swift_Message::newInstance('New')
        ->setFrom(array('noreply@host.com' => 'Notify'))
        ->setTo(array('host@host.com' => 'host'))
        ->setBody('News.')->addPart($html_body, 'text/html');
      $numSent = $mailer->send($message);
});```

Looks fine to me. :thumbsup:

Estou começando com Slim e gostaria de manda e-mail de uma que estou criando com Slim pode me Ajudar?