Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/*
4
 * This file is part of the Symfony package.
5
 *
6
 * (c) Fabien Potencier <fabien@symfony.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
namespace Symfony\Component\Mime;
13
 
14
use Symfony\Component\Mime\Header\Headers;
15
use Symfony\Component\Mime\Part\AbstractPart;
16
 
17
/**
18
 * @author Kevin Bond <kevinbond@gmail.com>
19
 */
20
class DraftEmail extends Email
21
{
22
    public function __construct(Headers $headers = null, AbstractPart $body = null)
23
    {
24
        parent::__construct($headers, $body);
25
 
26
        $this->getHeaders()->addTextHeader('X-Unsent', '1');
27
    }
28
 
29
    /**
30
     * Override default behavior as draft emails do not require From/Sender/Date/Message-ID headers.
31
     * These are added by the client that actually sends the email.
32
     */
33
    public function getPreparedHeaders(): Headers
34
    {
35
        $headers = clone $this->getHeaders();
36
 
37
        if (!$headers->has('MIME-Version')) {
38
            $headers->addTextHeader('MIME-Version', '1.0');
39
        }
40
 
41
        $headers->remove('Bcc');
42
 
43
        return $headers;
44
    }
45
}