A collection of MIME headers.

package Swift
subpackage Mime
author Chris Corbyn

 Methods

Add a new Date header using $timestamp (UNIX time).

addDateHeader(string $name, int $timestamp) 

Parameters

$name

string

$timestamp

int

Add a new ID header for Message-ID or Content-ID.

addIdHeader(string $name, string | array $ids) 

Parameters

$name

string

$ids

stringarray

Add a new Mailbox Header with a list of $addresses.

addMailboxHeader(string $name, array | string $addresses) 

Parameters

$name

string

$addresses

arraystring

Add a new ParameterizedHeader with $name, $value and $params.

addParameterizedHeader(string $name, string $value, array $params) 

Parameters

$name

string

$value

string

$params

array

Add a new Path header with an address (path) in it.

addPathHeader(string $name, string $path) 

Parameters

$name

string

$path

string

Add a new basic text header with $name and $value.

addTextHeader(string $name, string $value) 

Parameters

$name

string

$value

string

Notify this observer that the entity's charset has changed.

charsetChanged(string $charset) 
Inherited
inherited_from \Swift_Mime_CharsetObserver::charsetChanged()

Parameters

$charset

string

Define a list of Header names as an array in the correct order.

defineOrdering(array $sequence) 

These Headers will be output in the given order where present.

Parameters

$sequence

array

Get the header with the given $name.

get(string $name, int $index) : \Swift_Mime_Header

If multiple headers match, the actual one may be specified by $index. Returns NULL if none present.

Parameters

$name

string

$index

int

Returns

Get all headers with the given $name.

getAll(string $name) : array

Parameters

$name

string

Returns

array

Returns true if at least one header with the given $name exists.

has(string $name, int $index) : boolean

If multiple headers match, the actual one may be specified by $index.

Parameters

$name

string

$index

int

Returns

boolean

Create a new instance of this HeaderSet.

newInstance() : \Swift_Mime_HeaderSet

Remove the header with the given $name if it's set.

remove(string $name, int $index) 

If multiple headers match, the actual one may be specified by $index.

Parameters

$name

string

$index

int

Remove all headers with the given $name.

removeAll(string $name) 

Parameters

$name

string

Set a header in the HeaderSet.

set(\Swift_Mime_Header $header, int $index) 

The header may be a previously fetched header via get() or it may be one that has been created separately.

If $index is specified, the header will be inserted into the set at this offset.

Parameters

$index

int

Set a list of header names which must always be displayed when set.

setAlwaysDisplayed(array $names) 

Usually headers without a field value won't be output unless set here.

Parameters

$names

array

Returns a string with a representation of all headers.

toString() : string

Returns

string