src/Viserio/Component/Mail/Transport/LogTransport.php
protected function getMimeEntityString(Swift_Message $entity): string
    {
        $string = (string) $entity->getHeaders() . \PHP_EOL . $entity->getBody();

        foreach ($entity->getChildren() as $children) {
            $string .= \PHP_EOL . \PHP_EOL . $this->getMimeEntityString($children);
        }

        return $string;
    }
protected function getMimeEntityString(Swift_Message $entity): string
    {
        $string = (string) $entity->getHeaders() . \PHP_EOL . $entity->getBody();

        foreach ($entity->getChildren() as $children) {
            $string .= \PHP_EOL . \PHP_EOL . $this->getMimeEntityString($children);
        }

        return $string;
    }
Get a loggable string out of a Swiftmailer entity.

@param \Swift_Message $entity

@return string