setBody() public method

Set the body of this entity, either as a string, or as an instance of {@link Swift_OutputByteStream}.
public setBody ( mixed $body, string $contentType = null )
$body mixed
$contentType string optional
Esempio n. 1
0
 /**
  * Set the body of this entity, either as a string, or as an instance of
  * {@link Swift_OutputByteStream}.
  * 
  * @param mixed $body
  * @param string $contentType optional
  * @param string $charset optional
  */
 public function setBody($body, $contentType = null, $charset = null)
 {
     parent::setBody($body, $contentType);
     if (isset($charset)) {
         $this->setCharset($charset);
     }
     return $this;
 }
Esempio n. 2
0
 /**
  * Set the body of this entity, either as a string, or as an instance of
  * {@link Swift_OutputByteStream}.
  *
  * @param mixed  $body
  * @param string $contentType optional
  * @param string $charset     optional
  *
  * @return Swift_Mime_MimePart
  */
 public function setBody($body, $contentType = null, $charset = null)
 {
     if (isset($charset)) {
         $this->setCharset($charset);
     }
     $body = $this->_convertString($body);
     parent::setBody($body, $contentType);
     return $this;
 }