TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Mail\SwiftMailerAdapter Class Reference
Inheritance diagram for TYPO3\CMS\Core\Mail\SwiftMailerAdapter:
TYPO3\CMS\Core\Mail\MailerAdapterInterface t3lib_mail_SwiftMailerAdapter

Public Member Functions

 __construct ()
 
 mail ($to, $subject, $messageBody, $additionalHeaders=NULL, $additionalParameters=NULL, $fakeSending=FALSE)
 

Protected Member Functions

 unescapeShellArguments ($escapedString)
 
 setHeader ($headerName, $headerValue)
 
 setBody ($body)
 
 decode ($text, $encoding)
 
 fixSender ()
 

Protected Attributes

 $mailer
 
 $message
 
 $messageHeaders
 
 $boundary = ''
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Hook subscriber for using Swift Mailer with

Author
Jigal van Hemert jigal.nosp@m.@xs4.nosp@m.all.n.nosp@m.l
Deprecated:
since 6.1, will be removed two versions later - will be removed together with ::mail()

Definition at line 23 of file SwiftMailerAdapter.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::__construct ( )

Constructor

Returns
void

Definition at line 50 of file SwiftMailerAdapter.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Member Function Documentation

◆ decode()

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::decode (   $text,
  $encoding 
)
protected

Reverts encoding of body text

Parameters
string$textBody text to be decoded
string$encodingEncoding type to be reverted
Returns
string Decoded message body

Definition at line 265 of file SwiftMailerAdapter.php.

References $result, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Core\Mail\SwiftMailerAdapter\setBody().

◆ fixSender()

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::fixSender ( )
protected

Makes sure there is a correct sender set.

If there is no from header the returnpath will be used. If that also fails a fake address will be used to make sure Swift Mailer will be able to send the message. Some SMTP server will not accept mail messages without a valid sender.

Returns
void

Definition at line 314 of file SwiftMailerAdapter.php.

Referenced by TYPO3\CMS\Core\Mail\SwiftMailerAdapter\mail().

◆ mail()

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::mail (   $to,
  $subject,
  $messageBody,
  $additionalHeaders = NULL,
  $additionalParameters = NULL,
  $fakeSending = FALSE 
)

Parses parts of the mail message and sends it with the Swift Mailer functions

Parameters
string$toEmail address to send the message to
string$subjectSubject of mail message
string$messageBodyRaw body (may be multipart)
array$additionalHeadersAdditional mail headers
array$additionalParametersExtra parameters for the mail() command
boolean$fakeSendingIf set fake sending a mail
Exceptions

Implements TYPO3\CMS\Core\Mail\MailerAdapterInterface.

Definition at line 69 of file SwiftMailerAdapter.php.

References $result, TYPO3\CMS\Core\Mail\SwiftMailerAdapter\fixSender(), TYPO3\CMS\Core\Mail\SwiftMailerAdapter\setBody(), TYPO3\CMS\Core\Mail\SwiftMailerAdapter\setHeader(), TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode(), and TYPO3\CMS\Core\Mail\SwiftMailerAdapter\unescapeShellArguments().

◆ setBody()

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::setBody (   $body)
protected

Sets body of mail message. Handles multi-part and single part messages. Encoded body parts are decoded prior to adding them to the message object.

Parameters
string$bodyRaw body, may be multi-part
Returns
void

Definition at line 207 of file SwiftMailerAdapter.php.

References TYPO3\CMS\Core\Mail\SwiftMailerAdapter\decode().

Referenced by TYPO3\CMS\Core\Mail\SwiftMailerAdapter\mail().

◆ setHeader()

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::setHeader (   $headerName,
  $headerValue 
)
protected

Handles setting and replacing of mail headers

Parameters
string$headerNameName of header
string$headerValueValue of header
Returns
void

Definition at line 127 of file SwiftMailerAdapter.php.

Referenced by TYPO3\CMS\Core\Mail\SwiftMailerAdapter\mail().

◆ unescapeShellArguments()

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::unescapeShellArguments (   $escapedString)
protected

Tries to undo the action by escapeshellarg()

Parameters
string$escapedStringString escaped by escapeshellarg()
Returns
string String with escapeshellarg() action undone as best as possible

Definition at line 105 of file SwiftMailerAdapter.php.

References $result.

Referenced by TYPO3\CMS\Core\Mail\SwiftMailerAdapter\mail().

Member Data Documentation

◆ $boundary

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::$boundary = ''
protected

Definition at line 43 of file SwiftMailerAdapter.php.

◆ $mailer

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::$mailer
protected

Definition at line 28 of file SwiftMailerAdapter.php.

◆ $message

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::$message
protected

Definition at line 33 of file SwiftMailerAdapter.php.

◆ $messageHeaders

TYPO3\CMS\Core\Mail\SwiftMailerAdapter::$messageHeaders
protected

Definition at line 38 of file SwiftMailerAdapter.php.