Hi everyone,

I've been working with integrating SugarCRM for the past few weeks, and I came across a curious situation. Am trying to send emails using soap->send_mail. The result is this:
Code:
lt;div style="margin:0 auto;text-align:center;"gt; lt;pgt; lt;stylegt;lt;!-- body {font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 0.8em; color:#222222; background-color:#cccccc} #footer { padding: 1em; font-size: 0.85em; clear:both; width:850px; height: 60px; text-align: left; direction: ltr; text-indent: 0px;} --gt;lt;/stylegt; lt;/pgt; lt;table class="simplenews-template-background" style="font-size: 1em; width: 850px; text-align: left; margin: 0pt auto;" border="0" cellspacing="0" cellpadding="0" bgcolor="
That's what I see in my email. None of the left or right brackets/angles nor the ampersand (&) show up, causing what looks like an HTML decoded message. Sending out regular emails (non-HTML work just fine), but I cannot send HTML emails normally. I have the following code:
PHP Code:
$params = array(  array("name"=>"parent_id","value"=>$target_id),
                          array(
"name"=>"parent_type""value"=>$module),
                          array(
"name"=>"email_to""value"=>$email),
                          array(
"name"=>"email_cc""value"=>"support@spiderfinancial.com"),
                          array(
"name"=>"from_account""value"=>$user_id)
                       );
                       
        if(isset(
$keywords) && count($keywords)>0)
        {
          
$log->trace("Keywords array is detected");
              
          
//$templ = db_getEmailTemplate($link,$tmpl_id);
          
$tmpl find_EMAILTMPLName($soapclient,$session_id$tmpl_id);
          if(
$tmpl[id] != false){
              
$params[] = array("id"=>"id"value=>$tmpl[id]);
            if(
array_key_exists('subject'$tmpl))
            {
              
$subject stringMerge($tmpl[subject], $keywords);
              
$params[]= array("name"=>"subject","value"=>$subject);
            }
            else {
              
$log->error("Missing subject in the email template: $tmpl[subject]");              
            }

            if(
array_key_exists('body'$tmpl))
            {            
              
$body stringMerge($tmpl[body], $keywords);
              
$params[]= array("name"=>"description","value"=>$body);             
            }
            else {
              
$log->error ("Missing text-version of the the email template: $tmpl[body]");              
            }
            
            if(
array_key_exists('body_html'$tmpl))
            {            
              
$body_html stringMerge($tmpl[body_html], $keywords);
              
$params[]= array("name"=>"description_html","value"=>$body_html);             
            }
            else{
              
$log->error("Missing html-version of the the email template: $tmpl[body_html]");              
            }            
          }
          else {
            
$log->error("Missing/Invalid email template id: $tmpl[id]");            
          }
        }
        else{
          
$params[] = array("name"=>"id""value"=>$tmpl[id]);           

        }
        
        
$result $soapclient->send_email$session_id$params); 

Any ideas where I might be going wrong? Thanks!