Browse Source

When message being replied to has no Reply-To header, we use the From header to fill in the reply To address, so we have to account for that situation when building the Cc header

pdontthink 6 years ago
parent
commit
ef9fbfbd8f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/compose.php

+ 5 - 1
src/compose.php

@@ -175,8 +175,12 @@ function replyAllString($header) {
     /**
     /**
      * 1) Remove the addresses we'll be sending the message 'to'
      * 1) Remove the addresses we'll be sending the message 'to'
      */
      */
-    if (isset($header->reply_to)) {
+    if (isset($header->reply_to) && is_array($header->reply_to) && count($header->reply_to)) {
         $excl_ar = $header->getAddr_a('reply_to');
         $excl_ar = $header->getAddr_a('reply_to');
+    } else if (is_object($header->reply_to)) { /* unneccesarry, just for failsafe purpose */
+        $excl_ar = $header->getAddr_a('reply_to');
+    } else {
+        $excl_ar = $header->getAddr_a('from');
     }
     }
     /**
     /**
      * 2) Remove our identities from the CC list (they still can be in the
      * 2) Remove our identities from the CC list (they still can be in the