PHP Класс Contao\Email

The class functions as an adapter for the Swift mailer framework. It can be used to send e-mails via the PHP mail function or an SMTP server. Usage: $email = new Email(); $email->subject = 'Hello'; $email->text = 'Is it me you are looking for?'; $email->sendTo('[email protected]');
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$arrFailures array Invalid addresses
$blnEmbedImages boolean Embed images
$intPriority integer E-mail priority
$objMessage Swift_Message Message object
$strCharset string Character set
$strHtml string HTML part of the e-mail
$strImageDir string Image directory
$strLogFile string Log file name
$strSender string Sender e-mail address
$strSenderName string Sender name
$strSubject string E-mail subject
$strText string Text part of the e-mail

Открытые методы

Метод Описание
__construct ( ) Instantiate the object and load the mailer framework
__get ( string $strKey ) : mixed Return an object property
__set ( string $strKey, mixed $varValue ) Set an object property
addHeader ( string $strKey, string $strValue ) Add a custom text header
attachFile ( string $strFile, string $strMime = 'application/octet-stream' ) Attach a file
attachFileFromString ( string $strContent, string $strFilename, string $strMime = 'application/octet-stream' ) Attach a file from a string
hasFailures ( ) : boolean Return true if there are failures
replyTo ( ) Add ReplyTo e-mail addresses
sendBcc ( ) Add BCC e-mail addresses
sendCc ( ) Add CC e-mail addresses
sendTo ( ) : boolean Send the e-mail

Защищенные методы

Метод Описание
compileRecipients ( array $arrRecipients ) : array Extract the e-mail addresses from the func_get_args() arguments

Описание методов

__construct() публичный метод

Instantiate the object and load the mailer framework
public __construct ( )

__get() публичный метод

Return an object property
public __get ( string $strKey ) : mixed
$strKey string The property name
Результат mixed The property value

__set() публичный метод

Set an object property
public __set ( string $strKey, mixed $varValue )
$strKey string The property name
$varValue mixed The property value

addHeader() публичный метод

Add a custom text header
public addHeader ( string $strKey, string $strValue )
$strKey string The header name
$strValue string The header value

attachFile() публичный метод

Attach a file
public attachFile ( string $strFile, string $strMime = 'application/octet-stream' )
$strFile string The file path
$strMime string The MIME type (defaults to "application/octet-stream")

attachFileFromString() публичный метод

Attach a file from a string
public attachFileFromString ( string $strContent, string $strFilename, string $strMime = 'application/octet-stream' )
$strContent string The file content
$strFilename string The file name
$strMime string The MIME type (defaults to "application/octet-stream")

compileRecipients() защищенный метод

Extract the e-mail addresses from the func_get_args() arguments
protected compileRecipients ( array $arrRecipients ) : array
$arrRecipients array The recipients array
Результат array An array of e-mail addresses

hasFailures() публичный метод

Return true if there are failures
public hasFailures ( ) : boolean
Результат boolean True if there are failures

replyTo() публичный метод

Friendly name portions (e.g. Admin ) are allowed. The method takes an unlimited number of recipient addresses.
public replyTo ( )

sendBcc() публичный метод

Friendly name portions (e.g. Admin ) are allowed. The method takes an unlimited number of recipient addresses.
public sendBcc ( )

sendCc() публичный метод

Friendly name portions (e.g. Admin ) are allowed. The method takes an unlimited number of recipient addresses.
public sendCc ( )

sendTo() публичный метод

Friendly name portions (e.g. Admin ) are allowed. The method takes an unlimited number of recipient addresses.
public sendTo ( ) : boolean
Результат boolean True if the e-mail was sent successfully

Описание свойств

$arrFailures защищенное свойство

Invalid addresses
protected array $arrFailures
Результат array

$blnEmbedImages защищенное свойство

Embed images
protected bool $blnEmbedImages
Результат boolean

$intPriority защищенное свойство

E-mail priority
protected int $intPriority
Результат integer

$objMessage защищенное свойство

Message object
protected Swift_Message $objMessage
Результат Swift_Message

$strCharset защищенное свойство

Character set
protected string $strCharset
Результат string

$strHtml защищенное свойство

HTML part of the e-mail
protected string $strHtml
Результат string

$strImageDir защищенное свойство

Image directory
protected string $strImageDir
Результат string

$strLogFile защищенное свойство

Log file name
protected string $strLogFile
Результат string

$strSender защищенное свойство

Sender e-mail address
protected string $strSender
Результат string

$strSenderName защищенное свойство

Sender name
protected string $strSenderName
Результат string

$strSubject защищенное свойство

E-mail subject
protected string $strSubject
Результат string

$strText защищенное свойство

Text part of the e-mail
protected string $strText
Результат string