Mail: ezcMailPart
[ ]
[ Display-example ]
[ ]
[ ]
[ ]
[ ]
Class: ezcMailPart
|
Abstract base class for all mail MIME parts. [
source]
This base class provides functionality to store headers and to generate the mail part. Implementations of this class must handle the body of that parts themselves. They must also implement
generateBody() which is called when the message part is generated.
Descendents
Properties
|
ezcMailContentDispositionHeader |
read/write
|
$contentDisposition
Contains the information from the Content-Disposition field of this mail. This useful especially when you are investigating retrieved mail to see if a part is an attachment or should be displayed inline. However, it can also be used to set the same on outgoing mail. Note that the ezcMailFile part sets the Content-Disposition field itself based on it's own properties when sending mail. |
Method Summary
|
public ezcMailPart |
__construct(
)
Constructs a new mail part. |
|
public void |
appendExcludeHeaders(
$headers )
The array $headers will be excluded when the headers are generated. |
|
public string |
generate(
)
Returns the complete mail part including both the header and the body as a string. |
|
public abstract string |
generateBody(
)
Returns the body of this part as a string. |
|
public string |
generateHeaders(
)
Returns the headers set for this part as a RFC 822 string. |
|
public string |
getHeader(
$name )
Returns the RAW value of the header $name. |
|
public void |
setHeader(
$name, $value )
Sets the header $name to the value $value. |
|
public void |
setHeaders(
$headers )
Adds the headers $headers. |
Methods
__construct
ezcMailPart __construct(
)
Constructs a new mail part.
Redefined in descendants as
appendExcludeHeaders
void appendExcludeHeaders(
$headers )
The array $headers will be excluded when the headers are generated.
Parameters
| Name |
Type |
Description |
$headers |
array(string) |
|
See also:
ezcMailPart::generateHeaders().
generate
string generate(
)
Returns the complete mail part including both the header and the body as a string.
generateBody
string generateBody(
)
Returns the body of this part as a string.
This method is called automatically by generate() and subclasses and must implement it.
Redefined in descendants as
generateHeaders
string generateHeaders(
)
Returns the headers set for this part as a RFC 822 string.
Each header is separated by a line break. This method does not add the required two lines of space to separate the headers from the body of the part.
This function is called automatically by generate() and subclasses can override this method if they wish to set additional headers when the mail is generated.
See also:
ezcMailPart::setHeader().
Redefined in descendants as
getHeader
string getHeader(
string
$name )
Returns the RAW value of the header $name.
Returns an empty string if the header is not found. Getting headers is case insensitive. Getting the header 'Message-Id' will match both 'Message-ID' and 'MESSAGE-ID' as well as 'Message-Id'.
Parameters
| Name |
Type |
Description |
$name |
string |
|
setHeader
void setHeader(
string
$name, string
$value )
Sets the header $name to the value $value.
If the header is already set it will override the old value.
Note: The header Content-Disposition will be overwritten by the contents of the contentsDisposition property if set.
Parameters
| Name |
Type |
Description |
$name |
string |
|
$value |
string |
|
See also:
ezcMailPart::generateHeaders().
setHeaders
void setHeaders(
$headers )
Adds the headers $headers.
The headers specified in the associative array of the form array(headername=>value) will overwrite any existing header values.
Parameters
| Name |
Type |
Description |
$headers |
array(string=>string) |
|
Last updated: Thu, 01 Nov 2007