config smtp

This commit is contained in:
iIronside 2023-10-13 11:38:24 +03:00
parent add34538f1
commit dddef5cc1c
5 changed files with 18 additions and 7 deletions

View File

@ -1,4 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
'adminEmail' => 'supp0rt.friday@yandex.ru',
];

View File

@ -1,6 +1,9 @@
<?php
return [
'adminEmail' => 'admin@example.com',
'supportEmail' => 'support@example.com',
'adminEmail' => 'supp0rt.friday@yandex.ru',
'supportEmail' => 'supp0rt.friday@yandex.ru',
'senderEmail' => 'supp0rt.friday@yandex.ru',
'senderName' => 'Friday.support mailer',
'user.passwordResetTokenExpire' => 3600,
'user.passwordMinLength' => 8,
];

View File

@ -1,4 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
'adminEmail' => 'supp0rt.friday@yandex.ru',
];

View File

@ -1,4 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
'adminEmail' => 'supp0rt.friday@yandex.ru',
];

View File

@ -51,10 +51,18 @@ class ContactForm extends Model
public function sendEmail($email)
{
return Yii::$app->mailer->compose()
->setTo($email)
->setFrom([$this->email => $this->name])
->setTo($this->email)
->setFrom([Yii::$app->params['senderEmail'] => Yii::$app->params['senderName']])
// ->setReplyTo([$this->email => $this->name])
->setSubject($this->subject)
->setTextBody($this->body)
->send();
// return Yii::$app->mailer->compose()
// ->setTo($email)
// ->setFrom([$this->email => $this->name])
// ->setSubject($this->subject)
// ->setTextBody($this->body)
// ->send();
}
}