Swift_Mime_SimpleMimeEntity::setBody PHP Method

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
    public function setBody($body, $contentType = null)
    {
        if ($body !== $this->body) {
            $this->clearCache();
        }
        $this->body = $body;
        if (isset($contentType)) {
            $this->setContentType($contentType);
        }
        return $this;
    }

Usage Example

Beispiel #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;
 }
All Usage Examples Of Swift_Mime_SimpleMimeEntity::setBody