Class yii\symfonymailer\Message

Inheritanceyii\symfonymailer\Message » yii\mail\BaseMessage
Implementsyii\symfonymailer\MessageWrapperInterface
Source Code https://github.com/yiisoft/yii2-symfonymailer/blob/master/src/Message.php

Public Properties

Hide inherited properties

Property Type Description Defined By
$bcc \yii\symfonymailer\PsalmAddressList The type defined by the message interface is not strict enough. yii\symfonymailer\Message
$symfonyEmail \Symfony\Component\Mime\Email Symfony email instance. yii\symfonymailer\Message

Public Methods

Hide inherited methods

Method Description Defined By
__clone() yii\symfonymailer\Message
__construct() yii\symfonymailer\Message
__sleep() yii\symfonymailer\Message
addHeader() yii\symfonymailer\Message
attach() yii\symfonymailer\Message
attachContent() yii\symfonymailer\Message
embed() yii\symfonymailer\Message
embedContent() yii\symfonymailer\Message
getBcc() yii\symfonymailer\Message
getCc() yii\symfonymailer\Message
getCharset() yii\symfonymailer\Message
getDate() yii\symfonymailer\Message
getFrom() yii\symfonymailer\Message
getHeader() yii\symfonymailer\Message
getPriority() yii\symfonymailer\Message
getReplyTo() yii\symfonymailer\Message
getReturnPath() yii\symfonymailer\Message
getSender() yii\symfonymailer\Message
getSubject() yii\symfonymailer\Message
getSymfonyEmail() Returns a Symfony email instance. yii\symfonymailer\Message
getTo() yii\symfonymailer\Message
setBcc() yii\symfonymailer\Message
setCc() yii\symfonymailer\Message
setCharset() yii\symfonymailer\Message
setDate() yii\symfonymailer\Message
setFrom() yii\symfonymailer\Message
setHeader() yii\symfonymailer\Message
setHeaders() yii\symfonymailer\Message
setHtmlBody() yii\symfonymailer\Message
setPriority() yii\symfonymailer\Message
setReplyTo() yii\symfonymailer\Message
setReturnPath() yii\symfonymailer\Message
setSender() yii\symfonymailer\Message
setSubject() yii\symfonymailer\Message
setTextBody() yii\symfonymailer\Message
setTo() yii\symfonymailer\Message
toString() yii\symfonymailer\Message

Property Details

Hide inherited properties

$bcc public property

The type defined by the message interface is not strict enough.

public \yii\symfonymailer\PsalmAddressList $bcc null
$symfonyEmail public property

Symfony email instance.

public \Symfony\Component\Mime\Email $symfonyEmail null

Method Details

Hide inherited methods

__clone() public method

public void __clone ( )

                public function __clone()
{
    $this->email = clone $this->email;
}

            
__construct() public method

public void __construct ( array $config = [] )
$config

                public function __construct(array $config = [])
{
    $this->email = new Email();
    parent::__construct($config);
}

            
__sleep() public method

public void __sleep ( )

                public function __sleep(): array
{
    return ['email', 'charset'];
}

            
addHeader() public method

public void addHeader ( string $name, string $value )
$name
$value

                public function addHeader(string $name, string $value): self
{
    $this->email->getHeaders()->addTextHeader($name, $value);
    return $this;
}

            
attach() public method

public $this attach ( $fileName, array $options = [] )
$fileName string
$options \yii\symfonymailer\PsalmFileOptions

                public function attach($fileName, array $options = []): self
{
    $this->email->attachFromPath(
        $fileName,
        $options['fileName'] ?? $fileName,
        $options['contentType'] ?? FileHelper::getMimeType($fileName)
    );
    return $this;
}

            
attachContent() public method

public $this attachContent ( $content, array $options = [] )
$content resource|string
$options \yii\symfonymailer\PsalmFileOptions

                public function attachContent($content, array $options = []): self
{
    $this->email->attach($content, $options['fileName'] ?? null, $options['contentType'] ?? null);
    return $this;
}

            
embed() public method

public void embed ( $fileName, array $options = [] )
$fileName string
$options \yii\symfonymailer\PsalmFileOptions

                public function embed($fileName, array $options = []): string
{
    $name = $options['fileName'] ?? $fileName;
    $this->email->embedFromPath(
        $fileName,
        $name,
        $options['contentType'] ?? FileHelper::getMimeType($fileName)
    );
    return 'cid:' . $name;
}

            
embedContent() public method

public void embedContent ( $content, array $options = [] )
$content resource|string
$options \yii\symfonymailer\PsalmFileOptions

                public function embedContent($content, array $options = []): string
{
    if (empty($options['fileName'])) {
        throw new InvalidConfigException('A valid file name must be passed when embedding content');
    }
    $this->email->embed($content, $options['fileName'], $options['contentType'] ?? null);
    return 'cid:' . $options['fileName'];
}

            
getBcc() public method

public void getBcc ( )

                public function getBcc()
{
    return $this->convertAddressesToStrings($this->email->getBcc());
}

            
getCc() public method

public void getCc ( )

                public function getCc()
{
    return $this->convertAddressesToStrings($this->email->getCc());
}

            
getCharset() public method

public void getCharset ( )

                public function getCharset(): string
{
    return $this->charset;
}

            
getDate() public method

public void getDate ( )

                public function getDate(): ?DateTimeImmutable
{
    return $this->email->getDate();
}

            
getFrom() public method

public void getFrom ( )

                public function getFrom()
{
    return $this->convertAddressesToStrings($this->email->getFrom());
}

            
getHeader() public method

public void getHeader ( string $name )
$name

                public function getHeader(string $name): array
{
    $headers = $this->email->getHeaders();
    $values = [];
    /** @var HeaderInterface $header */
    foreach ($headers->all($name) as $header) {
        $values[] = $header->getBodyAsString();
    }
    return $values;
}

            
getPriority() public method

public void getPriority ( )

                public function getPriority(): int
{
    return $this->email->getPriority();
}

            
getReplyTo() public method

public void getReplyTo ( )

                public function getReplyTo()
{
    return $this->convertAddressesToStrings($this->email->getReplyTo());
}

            
getReturnPath() public method

public void getReturnPath ( )

                public function getReturnPath(): string
{
    $returnPath = $this->email->getReturnPath();
    return $returnPath === null ? '' : $returnPath->getAddress();
}

            
getSender() public method

public void getSender ( )

                public function getSender(): string
{
    $sender = $this->email->getSender();
    return $sender === null ? '' : $sender->getAddress();
}

            
getSubject() public method

public void getSubject ( )

                public function getSubject(): string
{
    return (string) $this->email->getSubject();
}

            
getSymfonyEmail() public method

Returns a Symfony email instance.

public \Symfony\Component\Mime\Email getSymfonyEmail ( )
return \Symfony\Component\Mime\Email

Symfony email instance.

                public function getSymfonyEmail(): Email
{
    return $this->email;
}

            
getTo() public method

public void getTo ( )

                public function getTo()
{
    return $this->convertAddressesToStrings($this->email->getTo());
}

            
setBcc() public method

public $this setBcc ( $bcc )
$bcc \yii\symfonymailer\PsalmAddressList

The type defined by the message interface is not strict enough

                public function setBcc($bcc): self
{
    $this->email->bcc(...$this->convertStringsToAddresses($bcc));
    return $this;
}

            
setCc() public method

public $this setCc ( $cc )
$cc \yii\symfonymailer\PsalmAddressList

                public function setCc($cc): self
{
    $this->email->cc(...$this->convertStringsToAddresses($cc));
    return $this;
}

            
setCharset() public method

public void setCharset ( $charset )
$charset

                public function setCharset($charset): self
{
    $this->charset = $charset;
    return $this;
}

            
setDate() public method

public void setDate ( DateTimeInterface $date )
$date

                public function setDate(DateTimeInterface $date): self
{
    $this->email->date($date);
    return $this;
}

            
setFrom() public method

public void setFrom ( $from )
$from array|string

                public function setFrom($from): self
{
    $this->email->from(...$this->convertStringsToAddresses($from));
    return $this;
}

            
setHeader() public method

public void setHeader ( string $name, $value )
$name
$value string|list

                public function setHeader(string $name, $value): self
{
    $headers = $this->email->getHeaders();
    $headers->remove($name);
    foreach ((array) $value as $v) {
        $headers->addTextHeader($name, $v);
    }
    return $this;
}

            
setHeaders() public method

public $this setHeaders ( array $headers )
$headers array>

                public function setHeaders(array $headers): self
{
    foreach ($headers as $name => $value) {
        $this->setHeader($name, $value);
    }
    return $this;
}

            
setHtmlBody() public method

public void setHtmlBody ( $html )
$html

                public function setHtmlBody($html): self
{
    $this->email->html($html, $this->charset);
    return $this;
}

            
setPriority() public method

public void setPriority ( integer $priority )
$priority

                public function setPriority(int $priority): self
{
    $this->email->priority($priority);
    return $this;
}

            
setReplyTo() public method

public $this setReplyTo ( $replyTo )
$replyTo \yii\symfonymailer\PsalmAddressList

                public function setReplyTo($replyTo): self
{
    $this->email->replyTo(...$this->convertStringsToAddresses($replyTo));
    return $this;
}

            
setReturnPath() public method

public void setReturnPath ( string $address )
$address

                public function setReturnPath(string $address): self
{
    $this->email->returnPath($address);
    return $this;
}

            
setSender() public method

public void setSender ( string $address )
$address

                public function setSender(string $address): self
{
    $this->email->sender($address);
    return $this;
}

            
setSubject() public method

public void setSubject ( $subject )
$subject

                public function setSubject($subject): self
{
    $this->email->subject($subject);
    return $this;
}

            
setTextBody() public method

public void setTextBody ( $text )
$text

                public function setTextBody($text): self
{
    $this->email->text($text, $this->charset);
    return $this;
}

            
setTo() public method

public $this setTo ( $to )
$to \yii\symfonymailer\PsalmAddressList

                public function setTo($to): self
{
    $this->email->to(...$this->convertStringsToAddresses($to));
    return $this;
}

            
toString() public method

public void toString ( )

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