In this Slim framework fork, PHP Mailer is included as mail client. To send mail has been made very easy.
Sample (from a route):
$app->get('/sendmail', function ($request, $response) {
$data = [
'name' => 'Johan van de Merwe',
'subject' => 'Slim Email works'
];
$result = $this->mail->send('email/test.twig', $data, function ($message, $data) {
$message->to('some@email.com', 'John Doe');
$message->subject($data['subject']);
// $message->from('mail@fromsomedomain.nl');
// $message->fromName('Jane Sender');
});
});