class MimePart

MIME message part.

Constants

ENCODING_BASE64

encoding

ENCODING_7BIT

encoding

ENCODING_8BIT

encoding

ENCODING_QUOTED_PRINTABLE

encoding

internal EOL

LineLength

private SequenceValue

private SequenceWord

Properties

string $body

Methods

setHeader(string $name, string|array|null $value, bool $append = false)

Sets a header.

mixed
getHeader(string $name)

Returns a header.

clearHeader(string $name)

Removes a header.

string|null
getEncodedHeader(string $name)

Returns an encoded header.

array
getHeaders()

Returns all headers.

setContentType(string $contentType, string|null $charset = null)

Sets Content-Type header.

setEncoding(string $encoding)

Sets Content-Transfer-Encoding header.

string
getEncoding()

Returns Content-Transfer-Encoding header.

addPart(MimePart|null $part = null)

Adds or creates new multipart.

setBody(string $body)

Sets textual body.

string
getBody()

Gets textual body.

string
getEncodedMessage()

Returns encoded message.

Details

at line 56
MimePart setHeader(string $name, string|array|null $value, bool $append = false)

Sets a header.

Parameters

string $name
string|array|null $value

value or pair email => name

bool $append

Return Value

MimePart

at line 101
mixed getHeader(string $name)

Returns a header.

Parameters

string $name

Return Value

mixed

at line 111
MimePart clearHeader(string $name)

Removes a header.

Parameters

string $name

Return Value

MimePart

at line 121
string|null getEncodedHeader(string $name)

Returns an encoded header.

Parameters

string $name

Return Value

string|null

at line 154
array getHeaders()

Returns all headers.

Return Value

array

at line 164
MimePart setContentType(string $contentType, string|null $charset = null)

Sets Content-Type header.

Parameters

string $contentType
string|null $charset

Return Value

MimePart

at line 175
MimePart setEncoding(string $encoding)

Sets Content-Transfer-Encoding header.

Parameters

string $encoding

Return Value

MimePart

at line 185
string getEncoding()

Returns Content-Transfer-Encoding header.

Return Value

string

at line 194
MimePart addPart(MimePart|null $part = null)

Adds or creates new multipart.

Parameters

MimePart|null $part

Return Value

MimePart

at line 204
MimePart setBody(string $body)

Sets textual body.

Parameters

string $body

Return Value

MimePart

at line 214
string getBody()

Gets textual body.

Return Value

string

at line 226
string getEncodedMessage()

Returns encoded message.

Return Value

string

Traits

SmartObject