Anyone come across this one?

Using drupal_mail and hook_mail, the plaintext message sent /w MimeMail off works fine but when Mimemail is on, the body of the message received is just the text Array.

function example_mail()
{
      $body = 'testing 123';
      $message['subject'] = 'test subject works';
      $message['body'][] = 'some sample text here';  // always shows in received email as: Array
}

Have another email w/ HTML sends correctly, the above message is just a simple plain-text test and will not work.

Is this normal? It looks like a bug, if I set at admin/config/system/mailsystem to DefaultMail the plain-text ones sends correctly and the html-text version also sends, but is all mashed up, non-html, as expected. When set admin/config/system/mailsystem to MimeMailSystem, only the HTML $message['body][] = get_html_text(); works, and the plaintext email received just has the word 'Array' in the body of the email.

Anyone MimeMail experts seen this behavior? Common? Know a fix?

Thank you!

Comments

sgabe’s picture

I think you are using another contrib module along with Mime Mail, perhaps SMTP?

darrell_ulm’s picture

Hmmm, the only extra mod being used is Mail System. Strange. Looking into the code again to see if anything else in there that would cause the anomaly.

darrell_ulm’s picture

Priority: Normal » Minor

Just an update:

It looks like this issue occurs if the parameters in hook_mail are not quite right when using MimeMail although still trying to figure out exactly what mix of parameters causes the issue. Most drupal_mail sends are working correctly using the module.

IWasBornToWin’s picture

@sgabe, I'm using smtp with mime...do I need to be? I'm now getting an array message also when sending an email via rules. When I first installed mime, this didn't happen, but now it is. The mail still delivers, but for each one, I get an error message. Will post message in a bit.

IWasBornToWin’s picture

I posted new issue here - http://drupal.org/node/1836624

darrell_ulm’s picture

Yeah, that may be a different issue. Everything is A-OK now, just had to be very careful with how I setup parameters in hook_mail() and also did not create the MimeMappings manually with the interface and did it inside code as per the examples provided in the module text files.

sgabe’s picture

Category: bug » support
Priority: Minor » Normal
Status: Active » Closed (fixed)

Seems to be fixed.