FIX 13.0 - error message says MAIN_DISABLE_ALL_MAILS is set when it isn't + unhandled swiftmailer error (failed recipients due to RFC 2822 non-compliance)
This commit is contained in:
parent
0c4884bb2c
commit
6cccd77508
@ -559,8 +559,10 @@ if (!$error && $massaction == 'confirm_presend')
|
|||||||
{
|
{
|
||||||
$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto);
|
$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto);
|
||||||
$resaction .= '<br><div class="error">'.$mailfile->error.'</div>';
|
$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>';
|
$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
|
// send mail
|
||||||
try {
|
try {
|
||||||
$result = $this->mailer->send($this->message);
|
$result = $this->mailer->send($this->message, $failedRecipients);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->error = $e->getMessage();
|
$this->error = $e->getMessage();
|
||||||
}
|
}
|
||||||
@ -902,6 +902,9 @@ class CMailFile
|
|||||||
|
|
||||||
$res = true;
|
$res = true;
|
||||||
if (!empty($this->error) || !$result) {
|
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);
|
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
|
||||||
$res = false;
|
$res = false;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user