abstract class MailContent

Base class for defining a mail part : a content with a Content/Type

Properties

protected string $_content_type
protected string $_custom_headers

Methods

__construct(string $content_type)

Constructor

string
getContentType()

Get content-type accessor

setContentType(string $c)

Set content-type accessor

string
toString()

Get text value for this part

setCustomHeaders(string $h)

Set custom headers

addCustomHeader(string $h)

Add a custom header

string
getCustomHeaders()

Get custom headers

string
getHeaders()

Get headers for this part ; abstract method to implemented in child classes

string
getFullHeaders()

Get all headers for this part

string
getContent()

Get the text content of this part (to implement in child classes)

Details

at line 43
__construct(string $content_type)

Constructor

Parameters

string $content_type Mime type of the part

at line 54
string getContentType()

Get content-type accessor

Return Value

string The mime type of the part

at line 62
setContentType(string $c)

Set content-type accessor

Parameters

string $c The mime type of the part

at line 73
string toString()

Get text value for this part

Headers and contents are merged

Return Value

string The text representation of this part (headers and content merged)

See also

MailMultipart::getContent

at line 87
setCustomHeaders(string $h)

Set custom headers

To add one header at a time call setCustomHeader()

Parameters

string $h String of headers to set

See also

MailContent::addCustomHeader

at line 98
addCustomHeader(string $h)

Add a custom header

Parameters

string $h One header to set (header: value)

at line 109
string getCustomHeaders()

Get custom headers

Return Value

string Get custom headers for this part

at line 120
abstract string getHeaders()

Get headers for this part ; abstract method to implemented in child classes

Return Value

string Mandatory headers for this part

at line 130
string getFullHeaders()

Get all headers for this part

All headers are returned, both mandatory headers and user-defined custom headers

Return Value

string The headers of this part

at line 141
abstract string getContent()

Get the text content of this part (to implement in child classes)

Return Value

string Returns a string representing the body of this part (headers excluded)