mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 04:20:49 +08:00
mailtest show error msg
This commit is contained in:
@@ -316,7 +316,7 @@ class ToolRepository extends BaseRepository
|
||||
* @param $body
|
||||
* @return bool
|
||||
*/
|
||||
public function sendMail($to, $subject, $body): bool
|
||||
public function sendMail($to, $subject, $body, $exception = false): bool
|
||||
{
|
||||
$log = "[SEND_MAIL]";
|
||||
$factory = new EsmtpTransportFactory();
|
||||
@@ -353,7 +353,11 @@ class ToolRepository extends BaseRepository
|
||||
return true;
|
||||
} catch (\Throwable $e) {
|
||||
do_log("$log, fail: " . $e->getMessage() . "\n" . $e->getTraceAsString(), 'error');
|
||||
return false;
|
||||
if ($exception) {
|
||||
throw $e;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user