Explorar o código

Minor - fix when adding custom headers

Julio Montoya %!s(int64=12) %!d(string=hai) anos
pai
achega
affc735986
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      main/inc/lib/mail.lib.inc.php

+ 5 - 0
main/inc/lib/mail.lib.inc.php

@@ -179,6 +179,10 @@ function api_mail_html($recipient_name, $recipient_email, $subject, $message, $s
                     break;
             }
         }
+    } else {
+        if (!empty($extra_headers)) {
+            $mail->AddCustomHeader($extra_headers);
+        }
     }
 
     // WordWrap the html body (phpMailer only fixes AltBody) FS#2988
@@ -187,6 +191,7 @@ function api_mail_html($recipient_name, $recipient_email, $subject, $message, $s
     // Send the mail message.
     if (!$mail->Send()) {
         //echo 'ERROR: mail not sent to '.$recipient_name.' ('.$recipient_email.') because of '.$mail->ErrorInfo.'<br />';
+        error_log('ERROR: mail not sent to '.$recipient_name.' ('.$recipient_email.') because of '.$mail->ErrorInfo.'<br />');
         return 0;
     }