If a single attachment fails, continue with the others instead of failing altogether

This commit is contained in:
nathangray 2018-12-03 10:19:38 -07:00 committed by Ralf Becker
parent 0eaf00b385
commit 92b7694bae

View File

@ -6759,6 +6759,8 @@ class Mail
$basedir = $data = '';
$needTempFile = true;
try
{
// do not change urls for absolute images (thanks to corvuscorax)
if (substr($url, 0, 5) !== 'data:')
{
@ -6849,6 +6851,13 @@ class Mail
$_html2parse = str_replace($images[0][$i], $images[1][$i].'="'.$cid.'"', $_html2parse);
}
}
}
catch(\Exception $e)
{
// Something went wrong with this attachment. Skip it.
error_log("Error adding inline attachment. " . $e->getMessage());
error_log($e->getTraceAsString());
}
$attachments [] = array(
'name' => $filename,
'type' => $mimeType,