Skip to content

Commit

Permalink
fix missing exception for php mailer (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbeig committed Nov 17, 2021
1 parent 8beefa8 commit 5e0be52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Goteo/Model/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Goteo\Util\Monolog\Processor\WebProcessor;
use PDOException;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception as PHPMailerException;

class Mail extends Model {
protected $Table = 'mail';
Expand Down Expand Up @@ -334,7 +335,7 @@ public function send(&$errors = array()) {
if($this->validate($errors)) {
try {
if (self::checkBlocked($this->to, $reason)) {
throw new \phpmailerException("The recipient is blocked due too many bounces or complaints [$reason]");
throw new PHPMailerException("The recipient is blocked due too many bounces or complaints [$reason]");
}

$allowed = false;
Expand Down Expand Up @@ -376,7 +377,7 @@ public function send(&$errors = array()) {

} catch(PDOException $e) {
$errors[] = "Error sending message: " . $e->getMessage();
} catch(\phpmailerException $e) {
} catch(PHPMailerException $e) {
$errors[] = $e->getMessage();
}
}
Expand Down

0 comments on commit 5e0be52

Please sign in to comment.