PHP Class Swift_Mime_SimpleMessage

Author: Chris Corbyn
Inheritance: extends Swift_Mime_MimePart, implements Swift_Mime_Message
Mostra file Open project: swiftmailer/swiftmailer Class Usage Examples

Public Methods

Method Description
__construct ( Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_IdGenerator $idGenerator, string $charset = null ) Create a new SimpleMessage with $headers, $encoder and $cache.
__toString ( ) : string Returns a string representation of this object.
addBcc ( string $address, string $name = null ) Add a Bcc: address to this message.
addBcc ( string $address, string $name = null ) : Swift_Mime_SimpleMessage Add a Bcc: address to this message.
addCc ( string $address, string $name = null ) Add a Cc: address to this message.
addCc ( string $address, string $name = null ) : Swift_Mime_SimpleMessage Add a Cc: address to this message.
addFrom ( string $address, string $name = null ) Add a From: address to this message.
addFrom ( string $address, string $name = null ) : Swift_Mime_SimpleMessage Add a From: address to this message.
addReplyTo ( string $address, string $name = null ) Add a Reply-To: address to this message.
addReplyTo ( string $address, string $name = null ) : Swift_Mime_SimpleMessage Add a Reply-To: address to this message.
addTo ( string $address, string $name = null ) Add a To: address to this message.
addTo ( string $address, string $name = null ) : Swift_Mime_SimpleMessage Add a To: address to this message.
attach ( Swift_Mime_MimeEntity $entity ) Attach a {@link Swift_Mime_MimeEntity} such as an Attachment or MimePart.
attach ( Swift_Mime_MimeEntity $entity ) : Swift_Mime_SimpleMessage Attach a {@link Swift_Mime_MimeEntity} such as an Attachment or MimePart.
detach ( Swift_Mime_MimeEntity $entity ) Remove an already attached entity.
detach ( Swift_Mime_MimeEntity $entity ) : Swift_Mime_SimpleMessage Remove an already attached entity.
embed ( Swift_Mime_MimeEntity $entity ) : string Attach a {@link Swift_Mime_MimeEntity} and return it's CID source.
getBcc ( ) : array Get the Bcc addresses of this message.
getCc ( ) : array Get the Cc address of this message.
getDate ( ) : DateTimeInterface Get the date at which this message was created.
getFrom ( ) : mixed Get the from address of this message.
getNestingLevel ( ) : integer Always returns {@link LEVEL_TOP} for a message instance.
getPriority ( ) : integer Get the priority of this message.
getReadReceiptTo ( ) : string Get the addresses to which a read-receipt will be sent.
getReplyTo ( ) : string Get the reply-to address of this message.
getReturnPath ( ) : string Get the return-path (bounce address) of this message.
getSender ( ) : string Get the sender of this message.
getSubject ( ) : string Get the subject of this message.
getTo ( ) : array Get the To addresses of this message.
setBcc ( mixed $addresses, string $name = null ) Set the Bcc addresses of this message.
setBcc ( mixed $addresses, string $name = null ) : Swift_Mime_SimpleMessage Set the Bcc addresses of this message.
setCc ( mixed $addresses, string $name = null ) Set the Cc addresses of this message.
setCc ( mixed $addresses, string $name = null ) : Swift_Mime_SimpleMessage Set the Cc addresses of this message.
setDate ( DateTimeInterface $dateTime ) Set the date at which this message was created.
setDate ( DateTimeInterface $dateTime ) : Swift_Mime_SimpleMessage Set the date at which this message was created.
setFrom ( string | array $addresses, string $name = null ) Set the from address of this message.
setFrom ( string | array $addresses, string $name = null ) : Swift_Mime_SimpleMessage Set the from address of this message.
setPriority ( integer $priority ) Set the priority of this message.
setPriority ( integer $priority ) : Swift_Mime_SimpleMessage Set the priority of this message.
setReadReceiptTo ( array $addresses ) Ask for a delivery receipt from the recipient to be sent to $addresses.
setReadReceiptTo ( array $addresses ) : Swift_Mime_SimpleMessage Ask for a delivery receipt from the recipient to be sent to $addresses.
setReplyTo ( mixed $addresses, string $name = null ) Set the reply-to address of this message.
setReplyTo ( mixed $addresses, string $name = null ) : Swift_Mime_SimpleMessage Set the reply-to address of this message.
setReturnPath ( string $address ) Set the return-path (the bounce address) of this message.
setReturnPath ( string $address ) : Swift_Mime_SimpleMessage Set the return-path (the bounce address) of this message.
setSender ( string $address, string $name = null ) Set the sender of this message.
setSender ( string $address, string $name = null ) : Swift_Mime_SimpleMessage Set the sender of this message.
setSubject ( string $subject ) Set the subject of this message.
setSubject ( string $subject ) : Swift_Mime_SimpleMessage Set the subject of this message.
setTo ( mixed $addresses, string $name = null ) Set the to addresses of this message.
setTo ( mixed $addresses, string $name = null ) : Swift_Mime_SimpleMessage Set the to addresses of this message.
toByteStream ( Swift_InputByteStream $is ) Write this message to a {@link Swift_InputByteStream}.
toString ( ) : string Get this message as a complete string.

Protected Methods

Method Description
becomeMimePart ( ) Turn the body of this message into a child of itself if needed
getIdField ( )

Private Methods

Method Description
getTopNestingLevel ( ) Get the highest nesting level nested inside this message

Method Details

__construct() public method

Create a new SimpleMessage with $headers, $encoder and $cache.
public __construct ( Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_IdGenerator $idGenerator, string $charset = null )
$headers Swift_Mime_HeaderSet
$encoder Swift_Mime_ContentEncoder
$cache Swift_KeyCache
$idGenerator Swift_IdGenerator
$charset string

__toString() public method

Returns a string representation of this object.
See also: toString()
public __toString ( ) : string
return string

addBcc() public method

If $name is passed this name will be associated with the address.
public addBcc ( string $address, string $name = null )
$address string
$name string optional

addBcc() public method

If $name is passed this name will be associated with the address.
public addBcc ( string $address, string $name = null ) : Swift_Mime_SimpleMessage
$address string
$name string optional
return Swift_Mime_SimpleMessage

addCc() public method

If $name is passed this name will be associated with the address.
public addCc ( string $address, string $name = null )
$address string
$name string optional

addCc() public method

If $name is passed this name will be associated with the address.
public addCc ( string $address, string $name = null ) : Swift_Mime_SimpleMessage
$address string
$name string optional
return Swift_Mime_SimpleMessage

addFrom() public method

If $name is passed this name will be associated with the address.
public addFrom ( string $address, string $name = null )
$address string
$name string optional

addFrom() public method

If $name is passed this name will be associated with the address.
public addFrom ( string $address, string $name = null ) : Swift_Mime_SimpleMessage
$address string
$name string optional
return Swift_Mime_SimpleMessage

addReplyTo() public method

If $name is passed this name will be associated with the address.
public addReplyTo ( string $address, string $name = null )
$address string
$name string optional

addReplyTo() public method

If $name is passed this name will be associated with the address.
public addReplyTo ( string $address, string $name = null ) : Swift_Mime_SimpleMessage
$address string
$name string optional
return Swift_Mime_SimpleMessage

addTo() public method

If $name is passed this name will be associated with the address.
public addTo ( string $address, string $name = null )
$address string
$name string optional

addTo() public method

If $name is passed this name will be associated with the address.
public addTo ( string $address, string $name = null ) : Swift_Mime_SimpleMessage
$address string
$name string optional
return Swift_Mime_SimpleMessage

attach() public method

Attach a {@link Swift_Mime_MimeEntity} such as an Attachment or MimePart.
public attach ( Swift_Mime_MimeEntity $entity )
$entity Swift_Mime_MimeEntity

attach() public method

Attach a {@link Swift_Mime_MimeEntity} such as an Attachment or MimePart.
public attach ( Swift_Mime_MimeEntity $entity ) : Swift_Mime_SimpleMessage
$entity Swift_Mime_MimeEntity
return Swift_Mime_SimpleMessage

becomeMimePart() protected method

Turn the body of this message into a child of itself if needed
protected becomeMimePart ( )

detach() public method

Remove an already attached entity.
public detach ( Swift_Mime_MimeEntity $entity )
$entity Swift_Mime_MimeEntity

detach() public method

Remove an already attached entity.
public detach ( Swift_Mime_MimeEntity $entity ) : Swift_Mime_SimpleMessage
$entity Swift_Mime_MimeEntity
return Swift_Mime_SimpleMessage

embed() public method

This method should be used when embedding images or other data in a message.
public embed ( Swift_Mime_MimeEntity $entity ) : string
$entity Swift_Mime_MimeEntity
return string

getBcc() public method

Get the Bcc addresses of this message.
public getBcc ( ) : array
return array

getCc() public method

Get the Cc address of this message.
public getCc ( ) : array
return array

getDate() public method

Get the date at which this message was created.
public getDate ( ) : DateTimeInterface
return DateTimeInterface

getFrom() public method

Get the from address of this message.
public getFrom ( ) : mixed
return mixed

getIdField() protected method

See also: Swift_Mime_SimpleMimeEntity::getIdField()
protected getIdField ( )

getNestingLevel() public method

Always returns {@link LEVEL_TOP} for a message instance.
public getNestingLevel ( ) : integer
return integer

getPriority() public method

The returned value is an integer where 1 is the highest priority and 5 is the lowest.
public getPriority ( ) : integer
return integer

getReadReceiptTo() public method

Get the addresses to which a read-receipt will be sent.
public getReadReceiptTo ( ) : string
return string

getReplyTo() public method

Get the reply-to address of this message.
public getReplyTo ( ) : string
return string

getReturnPath() public method

Get the return-path (bounce address) of this message.
public getReturnPath ( ) : string
return string

getSender() public method

Get the sender of this message.
public getSender ( ) : string
return string

getSubject() public method

Get the subject of this message.
public getSubject ( ) : string
return string

getTo() public method

Get the To addresses of this message.
public getTo ( ) : array
return array

setBcc() public method

If $name is passed and the first parameter is a string, this name will be associated with the address.
public setBcc ( mixed $addresses, string $name = null )
$addresses mixed
$name string optional

setBcc() public method

If $name is passed and the first parameter is a string, this name will be associated with the address.
public setBcc ( mixed $addresses, string $name = null ) : Swift_Mime_SimpleMessage
$addresses mixed
$name string optional
return Swift_Mime_SimpleMessage

setCc() public method

If $name is passed and the first parameter is a string, this name will be associated with the address.
public setCc ( mixed $addresses, string $name = null )
$addresses mixed
$name string optional

setCc() public method

If $name is passed and the first parameter is a string, this name will be associated with the address.
public setCc ( mixed $addresses, string $name = null ) : Swift_Mime_SimpleMessage
$addresses mixed
$name string optional
return Swift_Mime_SimpleMessage

setDate() public method

Set the date at which this message was created.
public setDate ( DateTimeInterface $dateTime )
$dateTime DateTimeInterface

setDate() public method

Set the date at which this message was created.
public setDate ( DateTimeInterface $dateTime ) : Swift_Mime_SimpleMessage
$dateTime DateTimeInterface
return Swift_Mime_SimpleMessage

setFrom() public method

You may pass an array of addresses if this message is from multiple people. If $name is passed and the first parameter is a string, this name will be associated with the address.
public setFrom ( string | array $addresses, string $name = null )
$addresses string | array
$name string optional

setFrom() public method

You may pass an array of addresses if this message is from multiple people. If $name is passed and the first parameter is a string, this name will be associated with the address.
public setFrom ( string | array $addresses, string $name = null ) : Swift_Mime_SimpleMessage
$addresses string | array
$name string optional
return Swift_Mime_SimpleMessage

setPriority() public method

The value is an integer where 1 is the highest priority and 5 is the lowest.
public setPriority ( integer $priority )
$priority integer

setPriority() public method

The value is an integer where 1 is the highest priority and 5 is the lowest.
public setPriority ( integer $priority ) : Swift_Mime_SimpleMessage
$priority integer
return Swift_Mime_SimpleMessage

setReadReceiptTo() public method

Ask for a delivery receipt from the recipient to be sent to $addresses.
public setReadReceiptTo ( array $addresses )
$addresses array

setReadReceiptTo() public method

Ask for a delivery receipt from the recipient to be sent to $addresses.
public setReadReceiptTo ( array $addresses ) : Swift_Mime_SimpleMessage
$addresses array
return Swift_Mime_SimpleMessage

setReplyTo() public method

You may pass an array of addresses if replies will go to multiple people. If $name is passed and the first parameter is a string, this name will be associated with the address.
public setReplyTo ( mixed $addresses, string $name = null )
$addresses mixed
$name string optional

setReplyTo() public method

You may pass an array of addresses if replies will go to multiple people. If $name is passed and the first parameter is a string, this name will be associated with the address.
public setReplyTo ( mixed $addresses, string $name = null ) : Swift_Mime_SimpleMessage
$addresses mixed
$name string optional
return Swift_Mime_SimpleMessage

setReturnPath() public method

Set the return-path (the bounce address) of this message.
public setReturnPath ( string $address )
$address string

setReturnPath() public method

Set the return-path (the bounce address) of this message.
public setReturnPath ( string $address ) : Swift_Mime_SimpleMessage
$address string
return Swift_Mime_SimpleMessage

setSender() public method

This does not override the From field, but it has a higher significance.
public setSender ( string $address, string $name = null )
$address string
$name string optional

setSender() public method

This does not override the From field, but it has a higher significance.
public setSender ( string $address, string $name = null ) : Swift_Mime_SimpleMessage
$address string
$name string optional
return Swift_Mime_SimpleMessage

setSubject() public method

Set the subject of this message.
public setSubject ( string $subject )
$subject string

setSubject() public method

Set the subject of this message.
public setSubject ( string $subject ) : Swift_Mime_SimpleMessage
$subject string
return Swift_Mime_SimpleMessage

setTo() public method

If multiple recipients will receive the message an array should be used. Example: array('[email protected]', '[email protected]' => 'A name') If $name is passed and the first parameter is a string, this name will be associated with the address.
public setTo ( mixed $addresses, string $name = null )
$addresses mixed
$name string optional

setTo() public method

If multiple recipients will receive the message an array should be used. Example: array('[email protected]', '[email protected]' => 'A name') If $name is passed and the first parameter is a string, this name will be associated with the address.
public setTo ( mixed $addresses, string $name = null ) : Swift_Mime_SimpleMessage
$addresses mixed
$name string optional
return Swift_Mime_SimpleMessage

toByteStream() public method

Write this message to a {@link Swift_InputByteStream}.
public toByteStream ( Swift_InputByteStream $is )
$is Swift_InputByteStream

toString() public method

Get this message as a complete string.
public toString ( ) : string
return string