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, string $charset = null ) : Swift_Mime_MimePart
$body mixed
$contentType string optional
$charset string optional
return Swift_Mime_MimePart
 public function setPlain($plain)
 {
     if (!isset($this->plainMimePart)) {
         $this->plainMimePart = \Swift_MimePart::newInstance($plain, 'text/plain');
     } else {
         $this->emailObj->detach($this->plainMimePart);
         $this->plainMimePart->setBody($plain);
     }
     if (!empty($plain)) {
         $this->emailObj->attach($this->plainMimePart);
     }
 }