Class Swift_Message_Mime

Description

Mime is the underbelly for Messages, Attachments, Parts, Embedded Images, Forwarded Mail, etc

In fact, every single component of the composed email is simply a new Mime document nested inside another When you piece an email together in this way you see just how straight-forward it really is

Located in /Swift/Message/Mime.php (line 23)


	
			
Direct descendents
Class Description
Swift_Message_Attachment Attachment component for Swift Mailer
Swift_Message_Part MIME Part body component for Swift Mailer
Swift_Message Swift Message class
Class Constant Summary
 HTML = "text/html"
 LEVEL_ALTERNATIVE = "alternative"
 LEVEL_MIXED = "mixed"
 LEVEL_RELATED = "related"
 LEVEL_TOP = "top"
 MISC = "application/octet-stream"
 PLAIN = "text/plain"
 SAFE_LENGTH = 1000
Variable Summary
Method Summary
static string generateBoundary ()
Swift_Message_Mime __construct ()
string addChild (Swift_Message_Mime $mime, [string $id = null], [int $after = 1])
string getContentType ()
string,Swift_File getData ()
string getEncoding ()
string getLE ()
string getLevel ()
boolean hasChild (string $id)
array listChildren ()
int numChildren ()
void preBuild ()
void removeChild (string $id)
void setContentType (string $type)
void setData (mixed $data)
void setEncoding (string $encoding, [boolean $recursive = false], [boolean $non_ascii = false])
boolean setLE (string $le)
void setLineWrap (int $len)
void uncacheAll ()
Variables
static array $usedBoundaries = array() (line 100)

A list of used MIME boundaries after they're generated.

  • access: protected
string $boundary = null (line 85)

The boundary used to separate mime parts

  • access: protected
Swift_Cache $cache (line 95)

An instance of Swift_Cache

  • access: protected
array $children = array() (line 80)

Nested mime parts

  • access: protected
string $data = "" (line 70)

The body of the documented (unencoded)

  • var: data
  • access: protected
Swift_Message_Headers $headers = null (line 65)

The header part of this MIME document

  • access: public
string $LE = "\r\n" (line 90)

The line ending characters needed

  • access: protected
int $wrap = 1000 (line 75)

Maximum line length

  • access: protected
Methods
static method generateBoundary (line 116)

Compute a unique boundary

  • access: public
static string generateBoundary ()
Constructor __construct (line 105)

Constructor

  • access: public
Swift_Message_Mime __construct ()

Redefined in descendants as:
addChild (line 393)

Nest a child mime part in this document

  • return: The identifier for this part
  • access: public
string addChild (Swift_Message_Mime $mime, [string $id = null], [int $after = 1])
  • Swift_Message_Mime $mime
  • string $id: The identifier to use, optional
  • int $after: Add the part before (-1) or after (+1) the other parts
build (line 481)

Compile the entire MIME document into a string The returned string may be used in other documents if needed.

  • access: public
buildData (line 279)

Get the data in the format suitable for sending

  • access: public
  • throws: Swift_FileException If the file stream given cannot be read
  • throws: Swift_Message_MimeException If some required headers have been forcefully removed
getChild (line 423)

Get a child document, identified by $id

  • return: The child document
  • access: public
  • throws: Swift_Message_MimeException If no such child exists
Swift_Message_Mime getChild (string $id)
  • string $id: The identifier for this child
getContentType (line 192)

Get the content type which has been set

The MIME 1.0 Content-Type is provided as a string

  • access: public
string getContentType ()
getData (line 269)

Return the string which makes up the body of this MIME document

  • access: public
string,Swift_File getData ()
getEncoding (line 245)

Get the encoding format used in this document

  • access: public
string getEncoding ()
getLE (line 160)

Get the line ending sequence

  • access: public
string getLE ()
getLevel (line 475)

Get the level at which this mime part would appear in a document

One of "mixed", "alternative" or "related"

  • access: public
  • abstract:
string getLevel ()

Redefined in descendants as:
hasChild (line 413)

Check if a child exists identified by $id

  • access: public
boolean hasChild (string $id)
  • string $id: Identifier to look for
listChildren (line 458)

List the IDs of all children in this document

  • access: public
array listChildren ()
numChildren (line 466)

Get the total number of children present in this document

  • access: public
int numChildren ()
preBuild (line 499)

Execute any logic needed prior to building

  • access: public
  • abstract:
void preBuild ()

Redefined in descendants as:
removeChild (line 440)

Remove a part from the document

  • access: public
  • throws: Swift_Message_MimeException If no such part exists
void removeChild (string $id)
  • string $id: The identifier of the child
setContentType (line 183)

Set the content type of this MIME document

  • access: public
void setContentType (string $type)
  • string $type: The content type to use in the same format as MIME 1.0 expects
setData (line 259)

Specify the string which makes up the body of this message HINT: You can always nest another MIME document here if you call it's build() method.

$data can be an object of Swift_File or a string

  • access: public
void setData (mixed $data)
  • mixed $data: The body of the document

Redefined in descendants as:
setEncoding (line 206)

Set the encoding format to be used on the body of the document

  • access: public
void setEncoding (string $encoding, [boolean $recursive = false], [boolean $non_ascii = false])
  • string $encoding: The encoding type used
  • boolean $recursive: If this encoding format should be used recursively. Note, this only takes effect if no encoding is set in the children.
  • boolean $non_ascii: If the encoding should only be applied when the string is not ascii.
setHeaders (line 130)

Replace the current headers with new ones

DO NOT DO THIS UNLESS YOU KNOW WHAT YOU'RE DOING!

  • access: public
void setHeaders (Swift_Message_Headers $headers)
setLE (line 139)

Set the line ending character to use

  • access: public
boolean setLE (string $le)
  • string $le: The line ending sequence
setLineWrap (line 381)

Set the size at which lines wrap around (includes the CRLF)

  • access: public
void setLineWrap (int $len)
  • int $len: The length of a line
uncacheAll (line 167)

Reset the entire cache state from this branch of the tree and traversing down through the children

  • access: public
void uncacheAll ()
Class Constants
HTML = "text/html" (line 32)

Constant for HTML emails

LEVEL_ALTERNATIVE = "alternative" (line 40)

Constant for MIME sections which must appear in the multipart/alternative section.

LEVEL_MIXED = "mixed" (line 48)

Constant for MIME sections which must appear in the multipart/mixed section.

LEVEL_RELATED = "related" (line 44)

Constant for MIME sections which must appear in the multipart/related section.

LEVEL_TOP = "top" (line 52)

Constant for MIME sections which must appear in the multipart/mixed section.

MISC = "application/octet-stream" (line 36)

Constant for miscellaneous mime type

PLAIN = "text/plain" (line 28)

Constant for plain-text emails

SAFE_LENGTH = 1000 (line 56)

Constant for safe line length in almost all places

VERY_SAFE_LENGTH = 76 (line 60)

Constant for really safe line length

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