PHP Класс TMail_Compat, atk4

Class for mail rendering and sending. This class is designed to be based on mail templates. Usually you set all the mail parameters such as from, to, bcc, subject and so on in the mail template, so in order to send the mail you should do the following:. $mail=$this->add('TMail')->loadTemplate('your_template')->send($to_address); However, you can redefine all the email parts after template load. $mail->loadTemplate('mail/template'); $mail->body="This is test e-mail"; $mail->send('[email protected]'); Or you can set the tags of the templates: $mail->body->setTag('server_name',$server_name); This method will set specified tag in all the message parts: subject, body, sign Multipart MIME messages are also supported. You can add attachments, as well as add text and HTML part: $mail ->setBodyType('both') // use both HTML and text part ->setBody($html) // default body is HTML for 'both' message type ->attachText($text); // adding text part for plain-text mode For non MIME compatible mail readers plain text part is also added. Content of this part depends on message type: - text and both types: text part content - html type: explanation message (see getBody() method for details) Created on 15.03.2007 by *Camper* ([email protected]) Changed on 08.04.2008 by *Camper* ([email protected])
Наследование: extends AbstractController
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$version

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

Свойство Тип Описание
$attrs
$body
$body_type
$boundary
$headers
$is_html
$mime
$plain_text
$sign
$template

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

Метод Описание
attachFile ( $file, $type, $name = null, $asstring = false ) Attaches a saved file.
attachHTML ( $html ) Attaches a provided HTML string as a HTML file.
attachText ( $text )
get ( $tag, $plain = true )
getBody ( ) Returns the rendered mail body, sign included.
getBoundary ( )
getFromAddr ( )
getHeaders ( )
getSign ( )
getTemplateEngine ( ) : SMlite
init ( )
loadDefaultTemplate ( )
loadTemplate ( $template, $type = '.txt' )
reset ( )
send ( $address, $add_params = null ) Does the actual send by calling mail() function.
set ( $tag, $value )
setBody ( $body ) Sets the body of the message.
setBodyType ( $type ) Sets the body type. Possible values: - text: plain text - html: HTML only - both: text and HTML.
setHeader ( $name, $value = null )
setIsHtml ( $is_html = true )
setTag ( $tag, $value = null )

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

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

Attaches a saved file.
public attachFile ( $file, $type, $name = null, $asstring = false )
$file any valid path to a file
$type valid mime type. e.g.: audio/mpeg image/jpeg application/zip audio/wav etc.
$name optional, sets the filename for message
$asstring if set to true, $file contains contents, not filename

attachHTML() публичный Метод

Attaches a provided HTML string as a HTML file.
public attachHTML ( $html )
$html any valid HTML code as a string

attachText() публичный Метод

public attachText ( $text )

get() публичный Метод

public get ( $tag, $plain = true )

getBody() публичный Метод

Returns the rendered mail body, sign included.
public getBody ( )

getBoundary() публичный Метод

public getBoundary ( )

getFromAddr() публичный Метод

public getFromAddr ( )

getHeaders() публичный Метод

public getHeaders ( )

getSign() публичный Метод

public getSign ( )

getTemplateEngine() публичный Метод

public getTemplateEngine ( ) : SMlite
Результат SMlite

init() публичный Метод

public init ( )

loadDefaultTemplate() публичный Метод

public loadDefaultTemplate ( )

loadTemplate() публичный Метод

public loadTemplate ( $template, $type = '.txt' )

reset() публичный Метод

public reset ( )

send() публичный Метод

Does the actual send by calling mail() function.
public send ( $address, $add_params = null )

set() публичный Метод

public set ( $tag, $value )

setBody() публичный Метод

Behaviour of this method depends on the body type specified with setBodyType(): - text: plain text mime part is set - html: html mime part only is set - both: html mime part only is set, text part should be added separately. This method does NOT accept SMlite object as a parameter.
public setBody ( $body )

setBodyType() публичный Метод

Sets the body type. Possible values: - text: plain text - html: HTML only - both: text and HTML.
public setBodyType ( $type )

setHeader() публичный Метод

public setHeader ( $name, $value = null )

setIsHtml() публичный Метод

public setIsHtml ( $is_html = true )

setTag() публичный Метод

public setTag ( $tag, $value = null )

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

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

protected $attrs

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

protected $body

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

protected $body_type

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

protected $boundary

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

protected $headers

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

protected $is_html

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

protected $mime

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

protected $plain_text

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

protected $sign

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

protected $template

$version публичное свойство

public $version