## Apache Zeta Components Manual :: Docs For Class ezcMailText

### Mail::ezcMailText

### Class ezcMailText

Mail part used for sending all forms of plain text.

Example: ezcMailText in a plain text message

1. $textPart=new ezcMailText ("This is a text message");

Example: ezcMailText in a HTML message

1. $textPart=new ezcMailText ("<html>This is an <b>HTML</b> message"</html>);
2. $textPart->subType='html';

Source for this file: /Mail/src/parts/text.php

    ezcMailPart
       |
       --ezcMailText

Version: | //autogen//

### Properties

string | read/write | `$charset` The characterset used for this text part. Defaults to 'us-ascii' while creating mail, and is always 'utf-8' while parsing mail.
string | read/write | `$encoding` The encoding of the text. Defaults to eight bit.
string | read | `$originalCharset` The characterset in which a text part originally was before the conversion to UTF-8 when parsing incomming mail.
string | read/write | `$subType` The subtype of this text part. Defaults to 'plain' for plain text. Use 'html' for HTML messages.
string | read/write | `$text` The main data of this text part.

### Inherited Member Variables

From ezcMailPart
protected | `ezcMailPart::$properties`

### Method Summary

public ezcMailText | `__construct( $text , [ $charset = "us-ascii"] , [ $encoding = ezcMail::EIGHT_BIT] , [ $originalCharset = 'us-ascii'] )` Constructs a new TextPart with the given $text, $charset and $encoding.
public string | `generateBody( )` Returns the generated text body of this part as a string.
public string | `generateHeaders( )` Returns the headers set for this part as a RFC822 compliant string.

### Inherited Methods

From ezcMailPart
public ezcMailPart | `ezcMailPart::__construct()` Constructs a new mail part.
public void | `ezcMailPart::appendExcludeHeaders()` The array $headers will be excluded when the headers are generated.
public string | `ezcMailPart::generate()` Returns the complete mail part including both the header and the body as a string.
public abstract string | `ezcMailPart::generateBody()` Returns the body of this part as a string.
public string | `ezcMailPart::generateHeaders()` Returns the headers set for this part as a RFC 822 string.
public mixed | `ezcMailPart::getHeader()` Returns the RAW value of the header $name.
protected string | `ezcMailPart::getHeaderCharset()` Returns the charset registered for the header $name.
public void | `ezcMailPart::setHeader()` Sets the header $name to the value $value and its charset to $charset.
protected void | `ezcMailPart::setHeaderCharset()` Sets the charset of the header $name to $value.
public void | `ezcMailPart::setHeaders()` Adds the headers $headers.

### Methods

#### __construct

ezcMailText __construct( string $text , [string $charset = "us-ascii"] , [string $encoding = ezcMail::EIGHT_BIT] , [string $originalCharset = 'us-ascii'] )

Constructs a new TextPart with the given $text, $charset and $encoding.

OriginalCharset is only used when parsing mail. Parsed mail will always be converted to UTF-8 in this case $originalCharset will hold the charset before it was converted.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$text` | string |
`$charset` | string |
`$encoding` | string |
`$originalCharset` | string |

##### Redefinition of:

Method | Description
--- | ---
`ezcMailPart::__construct()` | Constructs a new mail part.

#### generateBody

string generateBody( )

Returns the generated text body of this part as a string.

##### Redefinition of:

Method | Description
--- | ---
`ezcMailPart::generateBody()` | Returns the body of this part as a string.

#### generateHeaders

string generateHeaders( )

Returns the headers set for this part as a RFC822 compliant string.

This method does not add the required two lines of space to separate the headers from the body of the part.

##### Redefinition of:

Method | Description
--- | ---
`ezcMailPart::generateHeaders()` | Returns the headers set for this part as a RFC 822 string.

Documentation generated by phpDocumentor 1.4.3