A Message (RFC 2822) object.

package Swift
subpackage Mime
author Chris Corbyn

 Methods

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

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

Parameters

$charset

string

Generates a valid Message-ID and switches to it.

generateId() : string

Returns

string

Get the Bcc addresses for this message.

getBcc() : string[]

This method always returns an associative array, whereby the keys provide the actual email addresses.

Returns

string[]

Get the body content of this entity as a string.

getBody() : string
Inherited

Returns NULL if no body has been set.

inherited_from \Swift_Mime_MimeEntity::getBody()

Returns

string

Get the Cc addresses for this message.

getCc() : string[]

This method always returns an associative array, whereby the keys provide the actual email addresses.

Returns

string[]

Get all children nested inside this entity.

getChildren() : \Swift_Mime_MimeEntity[]
Inherited

These are not just the immediate children, but all children.

inherited_from \Swift_Mime_MimeEntity::getChildren()

Returns

Get the qualified content-type of this mime entity.

getContentType() : string
Inherited
inherited_from \Swift_Mime_MimeEntity::getContentType()

Returns

string

Get the origination date of the message as a UNIX timestamp.

getDate() : int

Returns

int

Get the From address(es) of this message.

getFrom() : string[]

This method always returns an associative array where the keys are the addresses.

Returns

string[]

Get the collection of Headers in this Mime entity.

getHeaders() : \Swift_Mime_Header[]
Inherited
inherited_from \Swift_Mime_MimeEntity::getHeaders()

Returns

Returns a unique ID for this entity.

getId() : string
Inherited

For most entities this will likely be the Content-ID, though it has no explicit semantic meaning and can be considered an identifier for programming logic purposes. If a Content-ID header is present, this value SHOULD match the value of the header.

inherited_from \Swift_Mime_MimeEntity::getId()

Returns

string

Get the level at which this entity shall be nested in final document.

getNestingLevel() : int
Inherited

The lower the value, the more outermost the entity will be nested.

see LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE
inherited_from \Swift_Mime_MimeEntity::getNestingLevel()

Returns

int

Get the Reply-To addresses for this message.

getReplyTo() : string[]

This method always returns an associative array where the keys provide the email addresses.

Returns

string[]

Get the return-path (bounce-detect) address.

getReturnPath() : string

Returns

string

Get the sender address for this message.

getSender() : string

This has a higher significance than the From address.

Returns

string

Get the subject of the message.

getSubject() : string

Returns

string

Get the To addresses for this message.

getTo() : string[]

This method always returns an associative array, whereby the keys provide the actual email addresses.

Returns

string[]

Set the Bcc address(es).

setBcc(mixed $addresses, string $name) 

Recipients set in this field will receive a 'blind-carbon-copy' of this message.

In other words, they will get the message, but any other recipients of the message will have no such knowledge of their receipt of it.

This method has the same synopsis as setFrom() and setTo().

Parameters

$addresses

mixed

$name

string

optional

Set the body content of this entity as a string.

setBody(string $body, string $contentType) 
Inherited
inherited_from \Swift_Mime_MimeEntity::setBody()

Parameters

$body

string

$contentType

string

optional

Set the Cc address(es).

setCc(mixed $addresses, string $name) 

Recipients set in this field will receive a 'carbon-copy' of this message.

This method has the same synopsis as setFrom() and setTo().

Parameters

$addresses

mixed

$name

string

optional

Set all children nested inside this entity.

setChildren(array $children) 
Inherited

This includes grandchildren.

inherited_from \Swift_Mime_MimeEntity::setChildren()

Parameters

Set the origination date of the message as a UNIX timestamp.

setDate(int $date) 

Parameters

$date

int

Set the From address of this message.

setFrom(mixed $addresses, string $name) 

It is permissible for multiple From addresses to be set using an array.

If multiple From addresses are used, you SHOULD set the Sender address and according to RFC 2822, MUST set the sender address.

An array can be used if display names are to be provided: i.e. array('email@address.com' => 'Real Name').

If the second parameter is provided and the first is a string, then $name is associated with the address.

Parameters

$addresses

mixed

$name

string

optional

Set the Reply-To address(es).

setReplyTo(mixed $addresses, string $name) 

Any replies from the receiver will be sent to this address.

It is permissible for multiple reply-to addresses to be set using an array.

This method has the same synopsis as setFrom() and setTo().

If the second parameter is provided and the first is a string, then $name is associated with the address.

Parameters

$addresses

mixed

$name

string

optional

Set the return-path (bounce-detect) address.

setReturnPath(string $address) 

Parameters

$address

string

Set the sender of this message.

setSender(mixed $address, string $name) 

If multiple addresses are present in the From field, this SHOULD be set.

According to RFC 2822 it is a requirement when there are multiple From addresses, but Swift itself does not require it directly.

An associative array (with one element!) can be used to provide a display- name: i.e. array('email@address' => 'Real Name').

If the second parameter is provided and the first is a string, then $name is associated with the address.

Parameters

$address

mixed

$name

string

optional

Set the subject of the message.

setSubject(string $subject) 

Parameters

$subject

string

Set the To address(es).

setTo(mixed $addresses, string $name) 

Recipients set in this field will receive a copy of this message.

This method has the same synopsis as setFrom() and setCc().

If the second parameter is provided and the first is a string, then $name is associated with the address.

Parameters

$addresses

mixed

$name

string

optional

Get this entire entity as a ByteStream.

toByteStream(\Swift_InputByteStream $is) 
Inherited
inherited_from \Swift_Mime_MimeEntity::toByteStream()

Parameters

$is

\Swift_InputByteStream

to write to

Get this entire entity in its string form.

toString() : string
Inherited
inherited_from \Swift_Mime_MimeEntity::toString()

Returns

string

 Constants

 

An entity which nests with the same precedence as a mime part

LEVEL_ALTERNATIVE 
Inherited
inherited_from \Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE
 

An entity which nests with the same precedence as an attachment

LEVEL_MIXED 
Inherited
inherited_from \Swift_Mime_MimeEntity::LEVEL_MIXED
   

Main message document; there can only be one of these

LEVEL_TOP 
Inherited
inherited_from \Swift_Mime_MimeEntity::LEVEL_TOP