$mailer = Yii::$app->mailer;
$mailer->enableSwiftMailerLogging = true;
$mailer->compose()
...
->send();
//Как получить ошибки которые возникли при отправке?
+ * In order to catch logs written by this class, you need to setup a log route for 'yii\swiftmailer\Logger::add' category.
+ * For example:
+ *
+ * ~~~
+ * 'log' => [
+ * 'targets' => [
+ * [
+ * 'class' => 'yii\log\FileTarget',
+ * 'categories' => ['yii\swiftmailer\Logger::add'],
+ * ],
+ * ],
+ * ],