class Message mixin Email

Traits

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 never
throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

__construct(Email $message)

Create a new message instance.

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

Add a "from" address to the message.

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

Set the "sender" of the message.

returnPath(Address|string $address)

Set the "return path" of the message.

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

Add a recipient to the message.

forgetTo()

Remove all "to" addresses from the message.

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

Add a carbon copy to the message.

forgetCc()

Remove all carbon copy addresses from the message.

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

Add a blind carbon copy to the message.

forgetBcc()

Remove all of the blind carbon copy addresses from the message.

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

Add a "reply to" address to the message.

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

Add a recipient to the message.

Address
createAddress(string $address, string|null $name = null)

Create a safe Symfony address instance.

Address|string
ensureAddressIsSafe(Address|string $address)

Ensure the given address cannot inject additional headers or commands.

array
ensureAddressesAreSafe(array $addresses)

Ensure the given addresses cannot inject additional headers or commands.

addAddressDebugHeader(string $header, array $addresses)

Add an address debug header for a list of recipients.

subject(string $subject)

Set the subject of the message.

priority(int $level)

Set the message priority level.

attach(Attachable|Attachment|string $file, array $options = [])

Attach a file to the message.

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

Attach in-memory data as an attachment.

string
embed(Attachable|Attachment|string $file)

Embed a file in the message and get the CID.

string
embedData(mixed $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

in ForwardsCalls at line 22
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

in ForwardsCalls at line 52
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

in ForwardsCalls at line 66
static protected never throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

Parameters

string $method

Return Value

never

Exceptions

BadMethodCallException

at line 27
__construct(Email $message)

Create a new message instance.

Parameters

Email $message

at line 35
Message from(array|string $address, string|null $name = null)

Add a "from" address to the message.

Parameters

array|string $address
string|null $name

Return Value

Message

at line 47
Message sender(array|string $address, string|null $name = null)

Set the "sender" of the message.

Parameters

array|string $address
string|null $name

Return Value

Message

at line 59
Message returnPath(Address|string $address)

Set the "return path" of the message.

Parameters

Address|string $address

Return Value

Message

at line 71
Message to(array|string $address, string|null $name = null, bool $override = false)

Add a recipient to the message.

Parameters

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

Return Value

Message

at line 87
Message forgetTo()

Remove all "to" addresses from the message.

Return Value

Message

at line 102
Message cc(array|string $address, string|null $name = null, bool $override = false)

Add a carbon copy to the message.

Parameters

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

Return Value

Message

at line 118
Message forgetCc()

Remove all carbon copy addresses from the message.

Return Value

Message

at line 133
Message bcc(array|string $address, string|null $name = null, bool $override = false)

Add a blind carbon copy to the message.

Parameters

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

Return Value

Message

at line 149
Message forgetBcc()

Remove all of the blind carbon copy addresses from the message.

Return Value

Message

at line 164
Message replyTo(array|string $address, string|null $name = null)

Add a "reply to" address to the message.

Parameters

array|string $address
string|null $name

Return Value

Message

at line 172
protected Message addAddresses(array|string $address, string|null $name, string $type)

Add a recipient to the message.

Parameters

array|string $address
string|null $name
string $type

Return Value

Message

at line 204
protected Address createAddress(string $address, string|null $name = null)

Create a safe Symfony address instance.

Parameters

string $address
string|null $name

Return Value

Address

at line 214
protected Address|string ensureAddressIsSafe(Address|string $address)

Ensure the given address cannot inject additional headers or commands.

Parameters

Address|string $address

Return Value

Address|string

at line 230
protected array ensureAddressesAreSafe(array $addresses)

Ensure the given addresses cannot inject additional headers or commands.

Parameters

array $addresses

Return Value

array

at line 240
protected Message addAddressDebugHeader(string $header, array $addresses)

Add an address debug header for a list of recipients.

Parameters

string $header
array $addresses

Return Value

Message

at line 253
Message subject(string $subject)

Set the subject of the message.

Parameters

string $subject

Return Value

Message

at line 263
Message priority(int $level)

Set the message priority level.

Parameters

int $level

Return Value

Message

at line 273
Message attach(Attachable|Attachment|string $file, array $options = [])

Attach a file to the message.

Parameters

Attachable|Attachment|string $file
array $options

Return Value

Message

at line 293
Message attachData(mixed $data, string $name, array $options = [])

Attach in-memory data as an attachment.

Parameters

mixed $data
string $name
array $options

Return Value

Message

at line 303
string embed(Attachable|Attachment|string $file)

Embed a file in the message and get the CID.

Parameters

Attachable|Attachment|string $file

Return Value

string

at line 342
string embedData(mixed $data, string $name, string|null $contentType = null)

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

Parameters

mixed $data
string $name
string|null $contentType

Return Value

string

at line 354
Email getSymfonyMessage()

Get the underlying Symfony Email instance.

Return Value

Email

at line 362
mixed __call(string $method, array $parameters)

Dynamically pass missing methods to the Symfony instance.

Parameters

string $method
array $parameters

Return Value

mixed