diff --git a/lib/CareerPortal.php b/lib/CareerPortal.php index f420d0d85..fdf3b6ec6 100755 --- a/lib/CareerPortal.php +++ b/lib/CareerPortal.php @@ -458,13 +458,24 @@ public function sendEmail($userID, $destination, $subject, $body) /* Send e-mail notification. */ //FIXME: Make subject configurable. - $mailer = new Mailer($this->_siteID, $userID); - $mailerStatus = $mailer->sendToOne( - array($destination, ''), - $subject, - $body, - true - ); + try + { + $mailer = new Mailer($this->_siteID, $userID); + $mailer->sendToOne( + array($destination, ''), + $subject, + $body, + true + ); + } + catch (\PHPMailer\PHPMailer\Exception $e) + { + // Mail not configured or unavailable - log and continue + error_log( + 'OpenCATS CareerPortal mail error (site=' . $this->_siteID . '): ' + . get_class($e) . ' [' . $e->getCode() . ']' + ); + } } }