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
파일 보기 프로젝트 열기: atk4/atk4

공개 프로퍼티들

프로퍼티 타입 설명
$version

보호된 프로퍼티들

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