Config mail.ru smtp

This commit is contained in:
iIronside
2023-10-18 10:48:38 +03:00
parent 5469a209a5
commit 233a8a6d10
9 changed files with 53 additions and 20 deletions

View File

@ -45,24 +45,15 @@ class ContactForm extends Model
/**
* Sends an email to the specified email address using the information collected by this model.
*
* @param string $email the target email address
* @return bool whether the email was sent
*/
public function sendEmail($email)
public function sendEmail()
{
return Yii::$app->mailer->compose()
->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();
}
}