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]');
파일 보기 프로젝트 열기: contao/core-bundle 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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