‪TYPO3CMS  9.5
TYPO3\CMS\Core\Mail\MailMessage Class Reference
Inheritance diagram for TYPO3\CMS\Core\Mail\MailMessage:

Public Member Functions

int send ()
 
bool isSent ()
 
array getFailedRecipients ()
 
TYPO3 CMS Core Mail MailMessage setReturnPath ($address)
 
TYPO3 CMS Core Mail MailMessage setSender ($address, $name=null)
 
TYPO3 CMS Core Mail MailMessage setFrom ($addresses, $name=null)
 
TYPO3 CMS Core Mail MailMessage setReplyTo ($addresses, $name=null)
 
TYPO3 CMS Core Mail MailMessage setTo ($addresses, $name=null)
 
TYPO3 CMS Core Mail MailMessage setCc ($addresses, $name=null)
 
TYPO3 CMS Core Mail MailMessage setBcc ($addresses, $name=null)
 
TYPO3 CMS Core Mail MailMessage setReadReceiptTo ($addresses)
 

Protected Member Functions

string array idnaEncodeAddresses ($addresses)
 
mixed idnaEncodeAddress ($email)
 

Protected Attributes

TYPO3 CMS Core Mail Mailer $mailer
 
string $mailerHeader = 'TYPO3'
 
bool $sent = false
 
array $failedRecipients = array( )
 

Private Member Functions

 initializeMailer ()
 

Detailed Description

Adapter for Swift_Mailer to be used by TYPO3 extensions

Definition at line 22 of file MailMessage.php.

Member Function Documentation

◆ getFailedRecipients()

array TYPO3\CMS\Core\Mail\MailMessage::getFailedRecipients ( )

Returns the recipients for which the mail was not accepted for delivery.

Returns
‪array the recipients who were not accepted for delivery

Definition at line 89 of file MailMessage.php.

References TYPO3\CMS\Core\Mail\MailMessage\$failedRecipients.

◆ idnaEncodeAddress()

mixed TYPO3\CMS\Core\Mail\MailMessage::idnaEncodeAddress (   $email)
protected

IDNA encode the domain part of an email address if it contains non ASCII characters

Parameters
mixed$email
Returns
‪mixed
See also
‪\TYPO3\CMS\Core\Utility\GeneralUtility::validEmail

Definition at line 250 of file MailMessage.php.

Referenced by TYPO3\CMS\Core\Mail\MailMessage\idnaEncodeAddresses().

◆ idnaEncodeAddresses()

string array TYPO3\CMS\Core\Mail\MailMessage::idnaEncodeAddresses (   $addresses)
protected

◆ initializeMailer()

TYPO3\CMS\Core\Mail\MailMessage::initializeMailer ( )
private

Definition at line 46 of file MailMessage.php.

Referenced by TYPO3\CMS\Core\Mail\MailMessage\send().

◆ isSent()

bool TYPO3\CMS\Core\Mail\MailMessage::isSent ( )

Checks whether the message has been sent.

Returns
‪bool

Definition at line 79 of file MailMessage.php.

References TYPO3\CMS\Core\Mail\MailMessage\$sent.

◆ send()

int TYPO3\CMS\Core\Mail\MailMessage::send ( )

◆ setBcc()

TYPO3 CMS Core Mail MailMessage TYPO3\CMS\Core\Mail\MailMessage::setBcc (   $addresses,
  $name = null 
)

Set the Bcc addresses of this message.

If $name is passed and the first parameter is a string, this name will be associated with the address.

Parameters
string | array$addresses
string$name‪optional
Returns
‪\TYPO3\CMS\Core\Mail\MailMessage

Definition at line 202 of file MailMessage.php.

References TYPO3\CMS\Core\Mail\MailMessage\idnaEncodeAddresses().

◆ setCc()

TYPO3 CMS Core Mail MailMessage TYPO3\CMS\Core\Mail\MailMessage::setCc (   $addresses,
  $name = null 
)

Set the Cc addresses of this message.

If $name is passed and the first parameter is a string, this name will be associated with the address.

Parameters
string | array$addresses
string$name‪optional
Returns
‪\TYPO3\CMS\Core\Mail\MailMessage

Definition at line 186 of file MailMessage.php.

References TYPO3\CMS\Core\Mail\MailMessage\idnaEncodeAddresses().

◆ setFrom()

TYPO3 CMS Core Mail MailMessage TYPO3\CMS\Core\Mail\MailMessage::setFrom (   $addresses,
  $name = null 
)

Set the from address of this message.

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.

Parameters
string | array$addresses
string$name‪optional
Returns
‪\TYPO3\CMS\Core\Mail\MailMessage

Definition at line 133 of file MailMessage.php.

References TYPO3\CMS\Core\Mail\MailMessage\idnaEncodeAddresses().

Referenced by TYPO3\CMS\Core\Mail\MailMessage\send().

◆ setReadReceiptTo()

TYPO3 CMS Core Mail MailMessage TYPO3\CMS\Core\Mail\MailMessage::setReadReceiptTo (   $addresses)

Ask for a delivery receipt from the recipient to be sent to $addresses.

Parameters
array$addresses
Returns
‪\TYPO3\CMS\Core\Mail\MailMessage

Definition at line 214 of file MailMessage.php.

References TYPO3\CMS\Core\Mail\MailMessage\idnaEncodeAddresses().

◆ setReplyTo()

TYPO3 CMS Core Mail MailMessage TYPO3\CMS\Core\Mail\MailMessage::setReplyTo (   $addresses,
  $name = null 
)

Set the reply-to address of this message.

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.

Parameters
string | array$addresses
string$name‪optional
Returns
‪\TYPO3\CMS\Core\Mail\MailMessage

Definition at line 151 of file MailMessage.php.

References TYPO3\CMS\Core\Mail\MailMessage\idnaEncodeAddresses().

Referenced by TYPO3\CMS\Core\Mail\MailMessage\send().

◆ setReturnPath()

TYPO3 CMS Core Mail MailMessage TYPO3\CMS\Core\Mail\MailMessage::setReturnPath (   $address)

Set the return-path (the bounce address) of this message.

Parameters
string$address
Returns
‪\TYPO3\CMS\Core\Mail\MailMessage

Definition at line 100 of file MailMessage.php.

References TYPO3\CMS\Core\Mail\MailMessage\idnaEncodeAddresses().

◆ setSender()

TYPO3 CMS Core Mail MailMessage TYPO3\CMS\Core\Mail\MailMessage::setSender (   $address,
  $name = null 
)

Set the sender of this message.

This does not override the From field, but it has a higher significance.

Parameters
string$address
string$name‪optional
Returns
‪\TYPO3\CMS\Core\Mail\MailMessage

Definition at line 115 of file MailMessage.php.

References TYPO3\CMS\Core\Mail\MailMessage\idnaEncodeAddresses().

◆ setTo()

TYPO3 CMS Core Mail MailMessage TYPO3\CMS\Core\Mail\MailMessage::setTo (   $addresses,
  $name = null 
)

Set the to addresses of this message.

If multiple recipients will receive the message an array should be used. Example: array('recei.nosp@m.ver@.nosp@m.domai.nosp@m.n.or.nosp@m.g', 'other.nosp@m.@dom.nosp@m.ain.o.nosp@m.rg' => 'A name')

If $name is passed and the first parameter is a string, this name will be associated with the address.

Parameters
string | array$addresses
string$name‪optional
Returns
‪\TYPO3\CMS\Core\Mail\MailMessage

Definition at line 170 of file MailMessage.php.

References TYPO3\CMS\Core\Mail\MailMessage\idnaEncodeAddresses().

Member Data Documentation

◆ $failedRecipients

array TYPO3\CMS\Core\Mail\MailMessage::$failedRecipients = array( )
protected

Holds the failed recipients after the message has been sent

Definition at line 42 of file MailMessage.php.

Referenced by TYPO3\CMS\Core\Mail\MailMessage\getFailedRecipients().

◆ $mailer

TYPO3 CMS Core Mail Mailer TYPO3\CMS\Core\Mail\MailMessage::$mailer
protected

Definition at line 26 of file MailMessage.php.

◆ $mailerHeader

string TYPO3\CMS\Core\Mail\MailMessage::$mailerHeader = 'TYPO3'
protected

This will be added as X-Mailer to all outgoing mails

Definition at line 30 of file MailMessage.php.

◆ $sent

bool TYPO3\CMS\Core\Mail\MailMessage::$sent = false
protected

TRUE if the message has been sent.

Definition at line 36 of file MailMessage.php.

Referenced by TYPO3\CMS\Core\Mail\MailMessage\isSent().