芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/Models/SmtpSetting.php
mail_driver !== 'smtp') { return [ 'success' => true, 'message' => __('messages.smtpSuccess') ]; } try { $tls = $this->mail_encryption === 'ssl'; $transport = new EsmtpTransport($this->mail_host, $this->mail_port, $tls); $transport->setUsername($this->mail_username); $transport->setPassword($this->mail_password); $transport->start(); if ($this->verified == 0) { $this->verified = 1; $this->save(); } return [ 'success' => true, 'message' => __('messages.smtpSuccess') ]; } catch (TransportException | \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; } public static function isVerified() { $data = self::first(); return $data->verified; } }