MailMessage extends Email
Adapter for Symfony Mime to be used by TYPO3 extensions, also provides some backwards-compatibility for previous TYPO3 installations where send() was baked into the MailMessage object.
Table of Contents
Properties
Methods
- addBcc() : Email
- addCc() : Email
- addFrom() : Email
- addReplyTo() : Email
- addTo() : Email
- isSent() : bool
- Checks whether the message has been sent.
- send() : bool
- Sends the message.
- setBcc() : MailMessage
- Set the Bcc addresses of this message.
- setCc() : MailMessage
- Set the Cc addresses of this message.
- setDate() : MailMessage
- Set the origination date of the message as a UNIX timestamp.
- setFrom() : MailMessage
- Set the from address of this message.
- setReadReceiptTo() : MailMessage
- Ask for a delivery receipt from the recipient to be sent to $addresses.
- setReplyTo() : MailMessage
- Set the reply-to address of this message.
- setReturnPath() : MailMessage
- Set the return-path (the bounce address) of this message.
- setSender() : MailMessage
- Set the sender of this message.
- setSubject() : MailMessage
- Set the subject of the message.
- setTo() : MailMessage
- Set the to addresses of this message.
- checkArguments() : void
- convertAddresses() : array<string|int, Address>
- Converts Addresses into Address/NamedAddress objects.
- convertNamedAddress() : array<string|int, Address>
- Converts address from [email, name] into Address objects.
Properties
$mailer
protected
Mailer
$mailer
$sent
TRUE if the message has been sent.
protected
bool
$sent
= false
Methods
addBcc()
public
addBcc(mixed ...$addresses) : Email
Parameters
- $addresses : mixed
Return values
EmailaddCc()
public
addCc(mixed ...$addresses) : Email
Parameters
- $addresses : mixed
Return values
EmailaddFrom()
public
addFrom(mixed ...$addresses) : Email
Parameters
- $addresses : mixed
Return values
EmailaddReplyTo()
public
addReplyTo(mixed ...$addresses) : Email
Parameters
- $addresses : mixed
Return values
EmailaddTo()
public
addTo(mixed ...$addresses) : Email
Parameters
- $addresses : mixed
Return values
EmailisSent()
Checks whether the message has been sent.
public
isSent() : bool
Return values
boolsend()
Sends the message.
public
send() : bool
This is a short-hand method. It is however more useful to create a Mailer instance which can be used via Mailer->send($message);
Return values
bool —whether the message was accepted or not
setBcc()
Set the Bcc addresses of this message.
public
setBcc(string|array<string|int, mixed> $addresses[, string $name = null ]) : MailMessage
If multiple recipients will receive the message an array should be used. Example: array('receiver@domain.org', 'other@domain.org' => 'A name')
If $name is passed and the first parameter is a string, this name will be associated with the address. If $name is passed and the first parameter is not a string, an exception is thrown.
Parameters
- $addresses : string|array<string|int, mixed>
- $name : string = null
-
optional
Return values
MailMessagesetCc()
Set the Cc addresses of this message.
public
setCc(string|array<string|int, mixed> $addresses[, string $name = null ]) : MailMessage
If multiple recipients will receive the message an array should be used. Example: array('receiver@domain.org', 'other@domain.org' => 'A name')
If $name is passed and the first parameter is a string, this name will be associated with the address. If $name is passed and the first parameter is not a string, an exception is thrown.
Parameters
- $addresses : string|array<string|int, mixed>
- $name : string = null
-
optional
Return values
MailMessagesetDate()
Set the origination date of the message as a UNIX timestamp.
public
setDate(int $date) : MailMessage
Parameters
- $date : int
Return values
MailMessagesetFrom()
Set the from address of this message.
public
setFrom(string|array<string|int, mixed> $addresses[, string $name = null ]) : MailMessage
You may pass an array of addresses if this message is from multiple people.
If $name is passed and the first parameter is a string, this name will be associated with the address. If $name is passed and the first parameter is not a string, an exception is thrown.
Parameters
- $addresses : string|array<string|int, mixed>
- $name : string = null
-
optional
Return values
MailMessagesetReadReceiptTo()
Ask for a delivery receipt from the recipient to be sent to $addresses.
public
setReadReceiptTo(string $address) : MailMessage
Parameters
- $address : string
Return values
MailMessagesetReplyTo()
Set the reply-to address of this message.
public
setReplyTo(string|array<string|int, mixed> $addresses[, string $name = null ]) : MailMessage
You may pass an array of addresses if replies will go to multiple people.
If $name is passed and the first parameter is a string, this name will be associated with the address. If $name is passed and the first parameter is not a string, an exception is thrown.
Parameters
- $addresses : string|array<string|int, mixed>
- $name : string = null
-
optional
Return values
MailMessagesetReturnPath()
Set the return-path (the bounce address) of this message.
public
setReturnPath(string $address) : MailMessage
Parameters
- $address : string
Return values
MailMessagesetSender()
Set the sender of this message.
public
setSender(string $address[, string $name = null ]) : MailMessage
This does not override the From field, but it has a higher significance.
Parameters
- $address : string
- $name : string = null
-
optional
Return values
MailMessagesetSubject()
Set the subject of the message.
public
setSubject(string $subject) : MailMessage
Parameters
- $subject : string
Return values
MailMessagesetTo()
Set the to addresses of this message.
public
setTo(string|array<string|int, mixed> $addresses[, string $name = null ]) : MailMessage
If multiple recipients will receive the message an array should be used. Example: array('receiver@domain.org', 'other@domain.org' => 'A name')
If $name is passed and the first parameter is a string, this name will be associated with the address. If $name is passed and the first parameter is not a string, an exception is thrown.
Parameters
- $addresses : string|array<string|int, mixed>
- $name : string = null
-
optional
Return values
MailMessagecheckArguments()
protected
checkArguments(mixed $addresses[, string|null $name = null ]) : void
Parameters
- $addresses : mixed
- $name : string|null = null
convertAddresses()
Converts Addresses into Address/NamedAddress objects.
protected
convertAddresses(string|array<string|int, mixed> $addresses) : array<string|int, Address>
Parameters
- $addresses : string|array<string|int, mixed>
Return values
array<string|int, Address>convertNamedAddress()
Converts address from [email, name] into Address objects.
protected
convertNamedAddress(mixed ...$args) : array<string|int, Address>
Parameters
- $args : mixed