// в params.php
return [
'adminEmail' => 'admin@main.com',
]
// в контроллере
if($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])){
Yii::$app->session->setFlash('contactFormSubmitted');
return $this->refresh();
}
...
'components' => [
...
'mailer' => [
...
'messageConfig' => [
...
'from' => ['noreply@site.com' => 'Site Name'],
...
],
...
],
...
]
...