Answer the question
In order to leave comments, you need to log in
Why are yii2 messages not being sent?
Here is the code in the model:
$user->generateSecretKey();
if($user->save())
{
return Yii::$app->mailer->compose('resetPassword', ['user' => $user])
->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name . ' (отправлено роботом)'])
->setTo($this->email)
->setSubject('Сброс пароля для ' . Yii::$app->name)
->send();
}
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => false,
],
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question