PHP Class yupe\components\Mail

Inheritance: extends CApplicationComponen\CApplicationComponent
Mostra file Open project: yupe/yupe Class Usage Examples

Public Properties

Property Type Description
$layout string Layout of the email body
$method string Method to send mail: ("mail", "sendmail", or "smtp").
$smtp array array( 'host' => 'example.com', 'username' => 'username', 'password' => '*******' );

Public Methods

Method Description
addAddress ( $address, string $name = '' )
getMailer ( ) : PHPMailer
getSubject ( ) : string
init ( )
reset ( )
send ( string $from, string | array $to, string $theme, string $body, boolean $isText = false, array $replyTo = [] ) : boolean Функция отправки сообщения:
setFrom ( $address, string $name = '' )
setSubject ( $subject )

Method Details

addAddress() public method

public addAddress ( $address, string $name = '' )
$address
$name string

getMailer() public method

public getMailer ( ) : PHPMailer
return PHPMailer

getSubject() public method

public getSubject ( ) : string
return string

init() public method

public init ( )

reset() public method

public reset ( )

send() public method

Функция отправки сообщения:
public send ( string $from, string | array $to, string $theme, string $body, boolean $isText = false, array $replyTo = [] ) : boolean
$from string - адрес отправителя
$to string | array - адрес(-а) получателя
$theme string - тема письма
$body string - тело письма
$isText boolean - является ли тело письма текстом
$replyTo array добавляет заголовок Reply-To, формат [email => имя]
return boolean отправилось ли письмо

setFrom() public method

public setFrom ( $address, string $name = '' )
$address
$name string

setSubject() public method

public setSubject ( $subject )
$subject

Property Details

$layout public_oe property

Layout of the email body
public string $layout
return string

$method public_oe property

Method to send mail: ("mail", "sendmail", or "smtp").
public string $method
return string

$smtp public_oe property

array( 'host' => 'example.com', 'username' => 'username', 'password' => '*******' );
public array $smtp
return array