title: Sendmail ZF2 spaces stripped out of subject
body: <p>I just created a mailer class for Zend Framework 2. It uses the Sendmail class. </p>
  
  <p>The problem is that I set the subject of the email with multiple words. Before sending I dump the subject and all the spaces are ok. After sending the email I check my gmail and all the spaces are stripped out of the subject. </p>
  
  <p>When I run the script I get "testemail" as the subject.</p>
  
  <p>Below a part of the class I created :</p>
  
  <pre><code>public function addFile($p_sPath, $p_sMimetype, $p_sFilename){
      $rFile = fopen($p_sPath,'rb');
      $this-&gt;_m_oAttachment = new Mimepart(fread($rFile,filesize($p_sPath)));
      $this-&gt;_m_oAttachment-&gt;type = $p_sMimetype;
      $this-&gt;_m_oAttachment-&gt;filename = $p_sFilename;
      $this-&gt;_m_oAttachment-&gt;disposition = 'attachment';
      $this-&gt;_m_oAttachment-&gt;encoding = Mime::ENCODING_BASE64;
  }
  
  
  public function sendEmail()
  {
      $aParts = (!is_null($this-&gt;_m_oAttachment)) 
              ? array($this-&gt;_m_oBodymessage, $this-&gt;_m_oAttachment) 
              : array($this-&gt;_m_oBodymessage);
  
      $this-&gt;_m_oBodypart-&gt;setParts($aParts);
  
      $this-&gt;_m_oMessage-&gt;setEncoding('utf-8')
                        -&gt;setBody($this-&gt;_m_oBodypart)
                        -&gt;addFrom($this-&gt;_fromAddress, $this-&gt;_fromName)
                        -&gt;addReplyTo($this-&gt;_fromAddress, $this-&gt;_fromName)
                        -&gt;setSubject($this-&gt;_subject);
                        // even here the spaces are still intact.
      $this-&gt;send($this-&gt;_m_oMessage);
  }
  
  
  
  $oMailer = $this-&gt;getLocator()-&gt;get('Core\Mailer');
  $oMailer-&gt;setBodyHtml('mail/mail.phtml', array('aData' =&gt; $aData));
  $oMailer-&gt;setSubject('test email');
  $oMailer-&gt;setRecipient('jacob@myemail.com', 'jacob');
  $oMailer-&gt;addFile(realpath(dirname(__file__). '/../../../../../'.$sPath.$sSubfolder.'/'.$sFilename), 'application/pdf', $aData['data']['eventID'].'_'.$aDeclaratie['data']['userID'].'.pdf');
  $oMailer-&gt;sendEmail();
  </code></pre>