Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Email.php

function Email::text

Parameters

resource|string|null $body:

Return value

$this

File

vendor/symfony/mime/Email.php, line 270

Class

Email
@author Fabien Potencier <fabien@symfony.com>

Namespace

Symfony\Component\Mime

Code

public function text($body, string $charset = 'utf-8') : static {
    if (null !== $body && !\is_string($body) && !\is_resource($body)) {
        throw new \TypeError(\sprintf('The body must be a string, a resource or null (got "%s").', get_debug_type($body)));
    }
    $this->cachedBody = null;
    $this->text = $body;
    $this->textCharset = $charset;
    return $this;
}
RSS feed
Powered by Drupal