In your config.php you should also configure a proper transport eg for a transport based of gmail account you could use
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
.....
'useFileTransport' => false,//set this property to false to send mails to real email addresses
//comment the following array to send mail using php's mail function
//
//
/* configurazione servizio email da usare in locale (localhost sviluppo) */
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.gmail.com',
'username' => 'your_gmail_username@gmail.com',
'password' => 'your_gmail_password',
'port' => '587',
'encryption' => 'tls',
],