2 $message['body'] sections in email not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dangaskin
Forum Newbie
Posts: 6
Joined: Thu Sep 16, 2010 6:26 pm

2 $message['body'] sections in email not working

Post by dangaskin »

Hi,

I want to have 2 $message['body'] sections in my email. The problem is that the second one overwrites the first one. If I take the second one out the first one writes perfectly but I if I leave the second one only the second will send.

Thanks,
Dan

Code: Select all

      case 'application':
       $confirm = MakeApplicantMessage($params['fname'], $params['title']);
      $message['headers']['Content-Type'] = $params['content-type'];
      $message['subject'] = t('!subject', array('!subject' => $params['subject']),$language->language);
      $message['body']['Message'] = t('!message', array('!message' =>  $confirm), $language->language); //1st $message['body'] for email message
      $message['body']['Content'] .= t('!content', array('!content' => $params['content']), $language->language);  //2nd $message['body'] for attachments
   
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: 2 $message['body'] sections in email not working

Post by requinix »

You can't have two bodies in an email message. If you want attachments, that's a completely separate issue: read the documentation for whatever you're using on how to do it.
Post Reply