Skip to content

Commit

Permalink
Merge pull request #1313 from b13/bugfix/7.x-mailer-exceptions
Browse files Browse the repository at this point in the history
[BUGFIX] catch Email Transport Exceptions
  • Loading branch information
derhansen authored Feb 6, 2025
2 parents 25eead7 + 263d5fb commit 97567b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Classes/Service/EmailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace DERHANSEN\SfEventMgt\Service;

use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
use TYPO3\CMS\Core\Mail\MailMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;

Expand Down Expand Up @@ -56,7 +57,10 @@ public function sendEmailMessage(
$email->attachFromPath($attachment);
}
}

return $email->send();
try {
return $email->send();
} catch (TransportExceptionInterface $e) {
return false;
}
}
}

0 comments on commit 97567b3

Please sign in to comment.