芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/app/Models/SmtpSetting.php
mail_driver !== 'smtp') { return [ 'success' => true, 'message' => __('messages.smtpSuccess') ]; } try { $transport = new \Swift_SmtpTransport($this->mail_host, $this->mail_port, $this->mail_encryption); $transport->setUsername($this->mail_username); $transport->setPassword($this->mail_password); $mailer = new \Swift_Mailer($transport); $mailer->getTransport()->start(); if ($this->verified == 0) { $this->verified = 1; $this->save(); } return [ 'success' => true, 'message' => __('messages.smtpSuccess') ]; } catch (\Swift_TransportException $e) { $this->verified = 0; $this->save(); return [ 'success' => false, 'message' => $e->getMessage() ]; } catch (\Exception $e) { $this->verified = 0; $this->save(); return [ 'success' => false, 'message' => $e->getMessage() ]; } } public function getSetSmtpMessageAttribute() { if ($this->verified === 0 && $this->mail_driver == 'smtp') { return '
' . __('messages.smtpNotSet') . '
Visit SMTP Settings
'; } return null; } }