Heyho,

by sending testmails with the build-in test-function, getting following error:
Fatal error: Cannot use string offset as an array in /www/htdocs/[...]/modules/htmlmail/htmlmail.module on line 77
Same with the 6.x.-1.3-version, upgraded because of this to dev-Version.

Has anybody the same issue?

Thanks and regards,

Comments

jboeger’s picture

yep, showed up all of a sudden. ???

barneylodge’s picture

Same problem here

pillarsdotnet’s picture

Status: Active » Postponed (maintainer needs more info)

Looks like something is setting $message['headers'] to a string instead of an array.

This is a horrible, horrible work-around, not a fix. But see if it helps, anyway:

diff --git a/htmlmail.module b/htmlmail.module
index 7c4a812..bde43bc 100644
--- a/htmlmail.module
+++ b/htmlmail.module
@@ -73,6 +73,15 @@ function htmlmail_mail_alter(&$message) {
   }
 
   if (!$plain_match) { // All good, make mail html
+    if (!is_array($message['headers'])) {
+      $headers = array();
+      foreach (explode('\n', $message['headers']) as $line) {
+        $parts = explode(': ', $line, 2);
+        if (!empty($parts[1])) {
+          $headers[$parts[0]] = $parts[1];
+        }
+      }
+    }
     $message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed;';
 
     // message body may be an array
pillarsdotnet’s picture

Version: 6.x-1.x-dev » 6.x-2.3
Status: Postponed (maintainer needs more info) » Closed (fixed)

The 6.x-2.x branch is now stable. I'm therefore closing all open 6.x-1.x issues.

Re-open if there is some reason that 6.x-2.x doesn't work for you.

jddeli’s picture

This is not working