diff --git a/includes/functions.custom.php b/includes/functions.custom.php index 45e7da1..e806a88 100644 --- a/includes/functions.custom.php +++ b/includes/functions.custom.php @@ -123,16 +123,16 @@ function enwiSendMailSmtp(string $html, string $subject, array $recipients, arra if (isset($recipients[0]) && is_array($recipients[0])) { for ($i = 0, $n = count($recipients); $i < $n; $i ++) { if (strlen($recipients[$i]['email'])) { - $mail->AddAddress($recipients[$i]['email'], ((strlen($recipients[$i]['name'])) ? html_entity_decode($recipients[$i]['name'], ENT_QUOTES, $encoding) : $recipients[$i]['email'])); + $mail->AddAddress($recipients[$i]['email'], ((strlen($recipients[$i]['name']) > 0) ? html_entity_decode($recipients[$i]['name'], ENT_QUOTES, $encoding) : $recipients[$i]['email'])); } } } else { - $mail->AddAddress($recipients['email'], ((strlen($recipients['name'])) ? html_entity_decode($recipients['name'], ENT_QUOTES, $encoding) : $recipients['email'])); + $mail->AddAddress($recipients['email'], ((strlen($recipients['name']) > 0) ? html_entity_decode($recipients['name'], ENT_QUOTES, $encoding) : $recipients['email'])); } // set replyto if needed if(filter_var($fromEmail, FILTER_VALIDATE_EMAIL)) { - $fromName = (strlen($fromName) > 0)?$fromName:''; + $fromName = (strlen($fromName) > 0)?$fromName:$fromEmail; $mail->addReplyTo($fromEmail, $fromName); }