Mailer implements MailerInterface
Adapter for Symfony/Mailer to be used by TYPO3 extensions.
This will use the setting in TYPO3_CONF_VARS to choose the correct transport for it to work out-of-the-box.
Attributes
- #[AsAlias]
- \TYPO3\CMS\Core\Mail\MailerInterface::class
- $public: true
- #[Autoconfigure]
- $public: true
Table of Contents
Interfaces
- MailerInterface
- Interface for mailers for sending emails. This should be used when injecting or creating an instance of the Mailer class, so it can be easily overridden.
Properties
- $eventDispatcher : EventDispatcherInterface|null
- $mailerHeader : string
- This will be added as X-Mailer to all outgoing mails
- $mailSettings : array<string|int, mixed>
- $sentMessage : SentMessage|null
- $transport : TransportInterface|null
Methods
- __construct() : mixed
- When constructing, also initializes the Symfony Transport like configured
- getRealTransport() : TransportInterface
- Returns the real transport (not a spool).
- getSentMessage() : SentMessage|null
- getTransport() : TransportInterface
- injectMailSettings() : mixed
- This method is only used in unit tests
- send() : void
- getTransportFactory() : TransportFactory
Properties
$eventDispatcher read-only
protected
EventDispatcherInterface|null
$eventDispatcher
= null
$mailerHeader
This will be added as X-Mailer to all outgoing mails
protected
string
$mailerHeader
= 'TYPO3'
$mailSettings
protected
array<string|int, mixed>
$mailSettings
= []
$sentMessage
protected
SentMessage|null
$sentMessage
$transport
protected
TransportInterface|null
$transport
= null
Methods
__construct()
When constructing, also initializes the Symfony Transport like configured
public
__construct([TransportInterface|null $transport = null ][, EventDispatcherInterface|null $eventDispatcher = null ]) : mixed
Parameters
- $transport : TransportInterface|null = null
-
optionally pass a transport to the constructor.
- $eventDispatcher : EventDispatcherInterface|null = null
Tags
getRealTransport()
Returns the real transport (not a spool).
public
getRealTransport() : TransportInterface
Return values
TransportInterfacegetSentMessage()
public
getSentMessage() : SentMessage|null
Return values
SentMessage|nullgetTransport()
public
getTransport() : TransportInterface
Return values
TransportInterfaceinjectMailSettings()
This method is only used in unit tests
public
injectMailSettings([array<string|int, mixed>|null $mailSettings = null ]) : mixed
Parameters
- $mailSettings : array<string|int, mixed>|null = null
send()
public
send(RawMessage $message[, Envelope|null $envelope = null ]) : void
Parameters
- $message : RawMessage
- $envelope : Envelope|null = null
getTransportFactory()
protected
getTransportFactory() : TransportFactory