PHP Class 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])
Inheritance: extends AbstractController
Afficher le fichier Open project: atk4/atk4

Méthodes publiques

Свойство Type Description
$version

Protected Properties

Свойство Type Description
$attrs
$body
$body_type
$boundary
$headers
$is_html
$mime
$plain_text
$sign
$template

Méthodes publiques

Méthode Description
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 )

Method Details

attachFile() public méthode

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() public méthode

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

attachText() public méthode

public attachText ( $text )

get() public méthode

public get ( $tag, $plain = true )

getBody() public méthode

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

getBoundary() public méthode

public getBoundary ( )

getFromAddr() public méthode

public getFromAddr ( )

getHeaders() public méthode

public getHeaders ( )

getSign() public méthode

public getSign ( )

getTemplateEngine() public méthode

public getTemplateEngine ( ) : SMlite
Résultat SMlite

init() public méthode

public init ( )

loadDefaultTemplate() public méthode

public loadDefaultTemplate ( )

loadTemplate() public méthode

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

reset() public méthode

public reset ( )

send() public méthode

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

set() public méthode

public set ( $tag, $value )

setBody() public méthode

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() public méthode

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

setHeader() public méthode

public setHeader ( $name, $value = null )

setIsHtml() public méthode

public setIsHtml ( $is_html = true )

setTag() public méthode

public setTag ( $tag, $value = null )

Property Details

$attrs protected_oe property

protected $attrs

$body protected_oe property

protected $body

$body_type protected_oe property

protected $body_type

$boundary protected_oe property

protected $boundary

$headers protected_oe property

protected $headers

$is_html protected_oe property

protected $is_html

$mime protected_oe property

protected $mime

$plain_text protected_oe property

protected $plain_text

$sign protected_oe property

protected $sign

$template protected_oe property

protected $template

$version public_oe property

public $version