fix 500 error

parent 55912306
...@@ -101,20 +101,26 @@ class Bid extends \common\components\ActiveRecordModel ...@@ -101,20 +101,26 @@ class Bid extends \common\components\ActiveRecordModel
public function send() public function send()
{ {
$email = Settings::getValue('bids-support-email'); try
{
$email = Settings::getValue('bids-support-email');
$message = Yii::$app->controller->view->render('@common/modules/bids/views/bid/mail-all', [ $message = Yii::$app->controller->view->render('@common/modules/bids/views/bid/mail-all', [
'model' => $this 'model' => $this
]); ]);
$headers = "MIME-Version: 1.0\r\n". $headers = "MIME-Version: 1.0\r\n".
"Content-Transfer-Encoding: 8bit\r\n". "Content-Transfer-Encoding: 8bit\r\n".
"Content-Type: text/html; charset=\"UTF-8\"\r\n". "Content-Type: text/html; charset=\"UTF-8\"\r\n".
"X-Mailer: PHP v.".phpversion()."\r\n". "X-Mailer: PHP v.".phpversion()."\r\n".
"From: Заявка с сайта TaskOn <robot@task-on.com>\r\n"; "From: Заявка с сайта TaskOn <robot@task-on.com>\r\n";
$subject = "Заявка с сайта TaskOn"; $subject = "Заявка с сайта TaskOn";
mail($email, $subject, $message, $headers); @mail($email, $subject, $message, $headers);
}
catch (Exception $e)
{
}
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment