Class Swift_Message

Description

Swift Message class

Located in /Swift/Message.php (line 26)

Swift_Message_Mime
   |
   --Swift_Message
Class Constant Summary
Variable Summary
string $libVersion
string $mimeWarning
array $references
Method Summary
Swift_Message __construct ([string $subject = ""], [string $body = null], [string $type = "text/plain"], [string $encoding = null], [string $charset = null])
string attach (Swift_Message_Mime $child, [string $id = null])
void detach (string $id)
void fixContentType ()
string generateId ([string $idstring = null])
array getBcc ()
mixed getBody ()
array getCc ()
string getCharset ()
string getDate ()
string getFrom ()
string getId ()
string getLevel ()
string getMimeWarning ()
int getPriority ()
Object getReference (string $where, string $key)
array getReplyTo ()
string getReturnPath ([boolean $smtp = false])
string getSubject ()
array getTo ()
boolean isFlowed ()
void moveBranchIn (string $type, string $nested_type, array $from, string $old_branch, string $new_branch, string $tag)
void moveBranchOut (array $from, string $old_branch, string $new_branch, string $tag)
void preBuild ()
void requestReadReceipt (string $request)
void setBcc (mixed $bcc)
void setBody (mixed $body)
void setCc (mixed $cc)
void setCharset (string $charset)
void setDate (int $date)
void setFlowed ([boolean $flowed = true])
void setFrom (string $from)
void setId (string $id)
void setMimeWarning ( $text)
void setPriority (int $priority)
void setReference (string $where, string $key, Object $ref)
void setReplyTo (mixed $replyto)
void setReturnPath (string $address)
void setSubject (string $subject)
void setTo (mixed $to)
boolean wantsReadReceipt ()
Variables
string $libVersion = "" (line 49)

The version of the library (Swift) if known.

  • access: protected
string $mimeWarning = null (line 44)

The MIME warning for client not supporting multipart content

  • access: protected
array $references = array(
"parent" => array("alternative" => null, "mixed" => null, "related" => null),"alternative"=>array(),"mixed"=>array(),"related"=>array())
(line 55)

A container for references to other objects.

This is used in some very complex logic when sub-parts get shifted around.

  • access: protected

Inherited Variables

Inherited from Swift_Message_Mime

Swift_Message_Mime::$boundary
Swift_Message_Mime::$cache
Swift_Message_Mime::$children
Swift_Message_Mime::$data
Swift_Message_Mime::$headers
Swift_Message_Mime::$LE
Swift_Message_Mime::$usedBoundaries
Swift_Message_Mime::$wrap
Methods
Constructor __construct (line 70)

Ctor.

  • access: public
Swift_Message __construct ([string $subject = ""], [string $body = null], [string $type = "text/plain"], [string $encoding = null], [string $charset = null])
  • string $subject: Message subject
  • string $body: Body
  • string $type: Content-type
  • string $encoding: Encoding
  • string $charset: Charset

Redefinition of:
Swift_Message_Mime::__construct()
Constructor
attach (line 518)

Attach a mime part or an attachment of some sort

Any descendant of Swift_Message_Mime can be added safely (including other Swift_Message objects for mail forwarding!!)

  • return: The identifier for the part
  • access: public
string attach (Swift_Message_Mime $child, [string $id = null])
  • Swift_Message_Mime $child: The document to attach
  • string $id: An identifier to use (one is returned otherwise)
detach (line 551)

Remove a nested MIME part

  • access: public
  • throws: Swift_Message_MimeException If no such part exists
void detach (string $id)
  • string $id: The ID of the attached part
fixContentType (line 582)

Sets the correct content type header by looking at what types of data we have set

  • access: protected
void fixContentType ()
generateId (line 165)

Create a RFC 2822 compliant message id, optionally based upon $idstring.

The message ID includes information about the current time, the server and some random characters.

string generateId ([string $idstring = null])
  • string $idstring: An optional string the base the ID on
getBcc (line 338)

Return the list of recipients in the Bcc: header

  • access: public
array getBcc ()
getBody (line 491)

Alias for getData()

  • return: The document body
  • access: public
mixed getBody ()
getCc (line 309)

Return the list of recipients in the Cc: header

  • access: public
array getCc ()
getCharset (line 393)

Get the charset used in the document

Returns null if none is set

  • access: public
string getCharset ()
getDate (line 375)

Get the date as it looks in the headers

  • access: public
string getDate ()
getFrom (line 227)

Get the address used in the From: header

  • access: public
string getFrom ()
getId (line 183)

Get the generated message ID for this message, including the <> quotes.

If generated automatically, or using generateId() this method returns a RFC2822 compliant Message-ID.

string getId ()
getLevel (line 144)

Get the level in the MIME hierarchy at which this section should appear.

  • access: public
string getLevel ()

Redefinition of:
Swift_Message_Mime::getLevel()
Get the level at which this mime part would appear in a document
getMimeWarning (line 507)

Get the MIME warning which is displayed to old clients

  • access: public
string getMimeWarning ()
getPriority (line 474)

Get the current message priority

Returns NULL if none set

  • access: public
int getPriority ()
getReference (line 135)

Get a reference to an object (for complex reasons).

  • access: protected
Object getReference (string $where, string $key)
  • string $where: Key 1
  • string $key: Key 2
getReplyTo (line 280)

Return the list of recipients in the Reply-To: header

  • access: public
array getReplyTo ()
getReturnPath (line 201)

Return the address used in the Return-Path: header

  • access: public
string getReturnPath ([boolean $smtp = false])
  • boolean $smtp: Return the address for SMTP command
getSubject (line 359)

Get the current subject used in the headers

  • access: public
string getSubject ()
getTo (line 251)

Return the list of recipients in the To: header

  • access: public
array getTo ()
isFlowed (line 418)

Check if the message format is set as flowed

  • access: public
boolean isFlowed ()
moveBranchIn (line 597)

Move a branch of the tree, containing all it's MIME parts onto another branch

  • access: protected
void moveBranchIn (string $type, string $nested_type, array $from, string $old_branch, string $new_branch, string $tag)
  • string $type: The content type on the branch itself
  • string $nested_type: The content type which may exist in the branch's parent
  • array $from: The array containing all the nodes presently
  • string $old_branch: The location of the branch now
  • string $new_branch: The location of the branch after moving
  • string $tag: The key to identify the branch by in it's new location
moveBranchOut (line 678)

Move a branch further toward the top of the tree

  • access: protected
void moveBranchOut (array $from, string $old_branch, string $new_branch, string $tag)
  • array $from: The array containing MIME parts from the old branch
  • string $old_branch: The name of the old branch
  • string $new_branch: The name of the new branch
  • string $tag: The key of the branch being moved
postAttachFixStructure (line 632)

Analyzes the mixing of MIME types in a mulitpart message an re-arranges if needed

It looks complicated and long winded but the concept is pretty simple, even if putting it in code does me make want to cry!

  • access: protected
void postAttachFixStructure ()
postDetachFixStructure (line 710)

Analyzes the mixing of MIME types in a mulitpart message an re-arranges if needed

It looks complicated and long winded but the concept is pretty simple, even if putting it in code does me make want to cry!

  • access: protected
void postDetachFixStructure ()
preBuild (line 763)

Execute needed logic prior to compilation

  • access: public
void preBuild ()

Redefinition of:
Swift_Message_Mime::preBuild()
Execute any logic needed prior to building
requestReadReceipt (line 445)

Request that the client send back a read-receipt (don't rely on this!)

  • access: public
void requestReadReceipt (string $request)
  • string $request: Request address
setBcc (line 322)

Set the list of recipients in the Bcc: header

  • access: public
void setBcc (mixed $bcc)
  • mixed $bcc: An array or a string
setBody (line 483)

Alias for setData()

  • access: public
void setBody (mixed $body)
  • mixed $body: Body
setCc (line 293)

Set the list of recipients in the Cc: header

  • access: public
void setCc (mixed $cc)
  • mixed $cc: An array or a string
setCharset (line 383)

Set the charset of the document

  • access: public
void setCharset (string $charset)
  • string $charset: The charset used
setDate (line 367)

Set the date in the headers in RFC 2822 format

  • access: public
void setDate (int $date)
  • int $date: The time as a UNIX timestamp
setFlowed (line 408)

Set the "format" attribute to flowed

  • access: public
void setFlowed ([boolean $flowed = true])
  • boolean $flowed: On or Off
setFrom (line 218)

Set the address in the From: header

  • access: public
void setFrom (string $from)
  • string $from: The address to set as From
setId (line 154)

Set the message id literally.

Unless you know what you are doing you should be using generateId() rather than this method, otherwise you may break compliancy with RFC 2822.

  • access: public
void setId (string $id)
  • string $id: The message ID string.
setMimeWarning (line 499)

Set the MIME warning message which is displayed to old clients

  • var: The full warning message (in 7bit ascii)
  • access: public
void setMimeWarning ( $text)
  • $text
setPriority (line 431)

Set the message prioirty in the mail client (don't rely on this)

  • access: public
void setPriority (int $priority)
  • int $priority: The priority as a value between 1 (high) and 5 (low)
setReference (line 124)

Sets a reference so when nodes are nested, operations can be redirected.

This really should be refactored to use just one array rather than dynamic variables.

  • access: protected
void setReference (string $where, string $key, Object $ref)
  • string $where: Key 1
  • string $key: Key 2
  • Object $ref: Reference
setReplyTo (line 264)

Set the list of recipients in the Reply-To: header

  • access: public
void setReplyTo (mixed $replyto)
  • mixed $replyto: An array or a string
setReturnPath (line 191)

Set the address in the Return-Path: header

  • access: public
void setReturnPath (string $address)
  • string $address: The bounce-detect address
setSubject (line 351)

Set the subject in the headers

  • access: public
void setSubject (string $subject)
  • string $subject: The subject of the email
setTo (line 235)

Set the list of recipients in the To: header

  • access: public
void setTo (mixed $to)
  • mixed $to: An array or a string
wantsReadReceipt (line 465)

Check if a read receipt has been requested for this message

  • access: public
boolean wantsReadReceipt ()

Inherited Methods

Inherited From Swift_Message_Mime

Swift_Message_Mime::__construct()
Swift_Message_Mime::addChild()
Swift_Message_Mime::build()
Swift_Message_Mime::buildData()
Swift_Message_Mime::generateBoundary()
Swift_Message_Mime::getChild()
Swift_Message_Mime::getContentType()
Swift_Message_Mime::getData()
Swift_Message_Mime::getEncoding()
Swift_Message_Mime::getLE()
Swift_Message_Mime::getLevel()
Swift_Message_Mime::hasChild()
Swift_Message_Mime::listChildren()
Swift_Message_Mime::numChildren()
Swift_Message_Mime::preBuild()
Swift_Message_Mime::removeChild()
Swift_Message_Mime::setContentType()
Swift_Message_Mime::setData()
Swift_Message_Mime::setEncoding()
Swift_Message_Mime::setHeaders()
Swift_Message_Mime::setLE()
Swift_Message_Mime::setLineWrap()
Swift_Message_Mime::uncacheAll()
Class Constants
PRIORITY_HIGH = 1 (line 31)

Constant from a high priority message (pretty meaningless)

PRIORITY_LOW = 5 (line 35)

Constant for a low priority message

PRIORITY_NORMAL = 3 (line 39)

Constant for a normal priority message

Inherited Constants

Inherited from Swift_Message_Mime

Swift_Message_Mime::HTML
Swift_Message_Mime::LEVEL_ALTERNATIVE
Swift_Message_Mime::LEVEL_MIXED
Swift_Message_Mime::LEVEL_RELATED
Swift_Message_Mime::LEVEL_TOP
Swift_Message_Mime::MISC
Swift_Message_Mime::PLAIN
Swift_Message_Mime::SAFE_LENGTH
Swift_Message_Mime::VERY_SAFE_LENGTH

Documentation generated on Wed, 26 Mar 2008 20:33:09 +1100 by phpDocumentor 1.3.1