Yii2 Mailer is extended by yii-mail-basemailer, which the compose()
would render an mail view with default layout.
[
'components' => [
'mailer' => [
'__class' => yii\swiftmailer\Mailer::class,
'htmlLayout' => false,
'transport' => [
'__class' => Swift_SmtpTransport::class,
// ...
],
],
// ...
],
// ...
],