[15/02/2025] Ajout d'un try/catch suite à messagerie pro OVH plus joignable via TLS depuis le 14/02/2025

This commit is contained in:
2025-02-15 11:12:41 +01:00
parent 0359d96baf
commit 5e4df025c6

View File

@@ -162,8 +162,17 @@ class MailerFactory
if (! empty($to)) { if (! empty($to)) {
$instance = $this->createEmailMessage($messageCode, $from, $to, $messageParameters, $locale, $cc, $bcc); $instance = $this->createEmailMessage($messageCode, $from, $to, $messageParameters, $locale, $cc, $bcc);
$sentCount = $this->send($instance, $failedRecipients); try {
$instance = $this->createEmailMessage($messageCode, $from, $to, $messageParameters, $locale, $cc, $bcc, $replyTo);
$sentCount = $this->send($instance, $failedRecipients);
} catch (\Exception $ex) {
Tlog::getInstance()->addError(
"Error while sending email message $messageCode: ".$ex->getMessage()
);
}
// $sentCount = $this->send($instance, $failedRecipients);
if ($sentCount == 0) { if ($sentCount == 0) {
Tlog::getInstance()->addError( Tlog::getInstance()->addError(
Translator::getInstance()->trans( Translator::getInstance()->trans(