Merge pull request #17655 from ATM-Consulting/FIX_13.0_wrong_error_message_MAIN_DISABLE_ALL_MAILS
FIX 13.0 - wrong error message for mail sending failure
This commit is contained in:
commit
5eeb7d474c
@ -559,8 +559,10 @@ if (!$error && $massaction == 'confirm_presend')
|
||||
{
|
||||
$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto);
|
||||
$resaction .= '<br><div class="error">'.$mailfile->error.'</div>';
|
||||
} else {
|
||||
} elseif (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
|
||||
$resaction .= '<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
|
||||
} else {
|
||||
$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '<br><div class="error">(unhandled error)</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -894,7 +894,7 @@ class CMailFile
|
||||
}
|
||||
// send mail
|
||||
try {
|
||||
$result = $this->mailer->send($this->message);
|
||||
$result = $this->mailer->send($this->message, $failedRecipients);
|
||||
} catch (Exception $e) {
|
||||
$this->error = $e->getMessage();
|
||||
}
|
||||
@ -902,6 +902,9 @@ class CMailFile
|
||||
|
||||
$res = true;
|
||||
if (!empty($this->error) || !$result) {
|
||||
if (!empty($failedRecipients)) {
|
||||
$this->error = 'Transport failed for the following addresses: "' . join('", "', $failedRecipients) . '".';
|
||||
}
|
||||
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
|
||||
$res = false;
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user