class Message mixin Email (View source)

Traits

Properties

protected Email $message

The Symfony Email instance.

protected array $embeddedFiles

CIDs of files embedded in the message.

Methods

mixed
forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

static void
throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

void
__construct(Email $message)

Create a new message instance.

$this
from(string|array $address, string|null $name = null)

Add a "from" address to the message.

$this
sender(string|array $address, string|null $name = null)

Set the "sender" of the message.

$this
returnPath(string $address)

Set the "return path" of the message.

$this
to(string|array $address, string|null $name = null, bool $override = false)

Add a recipient to the message.

$this
cc(string|array $address, string|null $name = null, bool $override = false)

Add a carbon copy to the message.

$this
bcc(string|array $address, string|null $name = null, bool $override = false)

Add a blind carbon copy to the message.

$this
replyTo(string|array $address, string|null $name = null)

Add a "reply to" address to the message.

$this
addAddresses(string|array $address, string $name, string $type)

Add a recipient to the message.

$this
subject(string $subject)

Set the subject of the message.

$this
priority(int $level)

Set the message priority level.

$this
attach(string $file, array $options = [])

Attach a file to the message.

$this
attachData(string $data, string $name, array $options = [])

Attach in-memory data as an attachment.

string
embed(string $file)

Embed a file in the message and get the CID.

string
embedData(string $data, string $name, string|null $contentType = null)

Embed in-memory data in the message and get the CID.

Email
getSymfonyMessage()

Get the underlying Symfony Email instance.

mixed
__call(string $method, array $parameters)

Dynamically pass missing methods to the Symfony instance.

Details

protected mixed forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

protected mixed forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

static protected void throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

Parameters

string $method

Return Value

void

Exceptions

BadMethodCallException

void __construct(Email $message)

Create a new message instance.

Parameters

Email $message

Return Value

void

$this from(string|array $address, string|null $name = null)

Add a "from" address to the message.

Parameters

string|array $address
string|null $name

Return Value

$this

$this sender(string|array $address, string|null $name = null)

Set the "sender" of the message.

Parameters

string|array $address
string|null $name

Return Value

$this

$this returnPath(string $address)

Set the "return path" of the message.

Parameters

string $address

Return Value

$this

$this to(string|array $address, string|null $name = null, bool $override = false)

Add a recipient to the message.

Parameters

string|array $address
string|null $name
bool $override

Return Value

$this

$this cc(string|array $address, string|null $name = null, bool $override = false)

Add a carbon copy to the message.

Parameters

string|array $address
string|null $name
bool $override

Return Value

$this

$this bcc(string|array $address, string|null $name = null, bool $override = false)

Add a blind carbon copy to the message.

Parameters

string|array $address
string|null $name
bool $override

Return Value

$this

$this replyTo(string|array $address, string|null $name = null)

Add a "reply to" address to the message.

Parameters

string|array $address
string|null $name

Return Value

$this

protected $this addAddresses(string|array $address, string $name, string $type)

Add a recipient to the message.

Parameters

string|array $address
string $name
string $type

Return Value

$this

$this subject(string $subject)

Set the subject of the message.

Parameters

string $subject

Return Value

$this

$this priority(int $level)

Set the message priority level.

Parameters

int $level

Return Value

$this

$this attach(string $file, array $options = [])

Attach a file to the message.

Parameters

string $file
array $options

Return Value

$this

$this attachData(string $data, string $name, array $options = [])

Attach in-memory data as an attachment.

Parameters

string $data
string $name
array $options

Return Value

$this

string embed(string $file)

Embed a file in the message and get the CID.

Parameters

string $file

Return Value

string

string embedData(string $data, string $name, string|null $contentType = null)

Embed in-memory data in the message and get the CID.

Parameters

string $data
string $name
string|null $contentType

Return Value

string

Email getSymfonyMessage()

Get the underlying Symfony Email instance.

Return Value

Email

mixed __call(string $method, array $parameters)

Dynamically pass missing methods to the Symfony instance.

Parameters

string $method
array $parameters

Return Value

mixed