PHP 8.3.31
Preview: MessagePart.php Size: 1.36 KB
/home/getspomw/royalsquad.us/vendor/symfony/mime/Part/MessagePart.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Mime\Part;

use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\RawMessage;

/**
 * @final
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class MessagePart extends DataPart
{
    public function __construct(
        private RawMessage $message,
    ) {
        if ($message instanceof Message) {
            $name = $message->getHeaders()->getHeaderBody('Subject').'.eml';
        } else {
            $name = 'email.eml';
        }
        parent::__construct('', $name);
    }

    public function getMediaType(): string
    {
        return 'message';
    }

    public function getMediaSubtype(): string
    {
        return 'rfc822';
    }

    public function getBody(): string
    {
        return $this->message->toString();
    }

    public function bodyToString(): string
    {
        return $this->getBody();
    }

    public function bodyToIterable(): iterable
    {
        return $this->message->toIterable();
    }

    public function __sleep(): array
    {
        return ['message'];
    }

    public function __wakeup(): void
    {
        $this->__construct($this->message);
    }
}

Directory Contents

Dirs: 1 × Files: 8

Name Size Perms Modified Actions
Multipart DIR
- drwxrwxrwx 2026-04-21 21:31:49
Edit Download
2.23 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.49 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
4.50 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
5.18 KB lrw-r--r-- 2026-04-26 11:34:58
Edit Download
1.07 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.36 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
2.34 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
7.80 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).