The docs for hook_mail ( http://api.drupal.org/api/function/hook_mail/6 ) state that $message['body'] should be an array, yet webform sets it to a string. This can cause errors if another module uses hook_mail_alter, and tries to add to the array with $message['body'][] = 'My addition...' . Patch follows.

--- webform.module (revision 1722)
+++ webform.module (working copy)
@@ -1197,7 +1197,7 @@
function webform_mail($key, &$message, $params) {
$message['headers'] = array_merge($message['headers'], $params['headers']);
$message['subject'] = $params['subject'];
- $message['body'] = $params['message'];
+ $message['body'] = preg_split('/\r?\n/', $params['message']);
}

/**

Comments

quicksketch’s picture

Status: Active » Fixed

Thanks for the patch (sorry it took so long to review)! I think this also fixes #344668: Error Message : Unable to send e-mail. . Committed.

quicksketch’s picture

This issue caused the bug #360266: Extra Line Between Output Fields in E-mails. Which was fixed in that issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.