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"
 MISC = "application/octet-stream"
 PLAIN = "text/plain"
 SAFE_LENGTH = 1000
Method Summary
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, [string $recursive = false])
boolean setLE (string $le)
void setLevel (string $level)
void setLineWrap (int $len)
void uncacheAll ()
Methods
Constructor __construct (line 90)

Constructor

Swift_Message_Mime __construct ()

Redefined in descendants as:
addChild (line 358)

Nest a child mime part in this document

  • return: The identifier for this part
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 464)

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

buildData (line 242)

Get the data in the format suitable for sending

  • 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 388)

Get a child document, identified by $id

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

Get the content type which has been set

The MIME 1.0 Content-Type is provided as a string

string getContentType ()
getData (line 232)

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

string,Swift_File getData ()
getEncoding (line 207)

Get the encoding format used in this document

string getEncoding ()
getLE (line 133)

Get the line ending sequence

string getLE ()
getLevel (line 455)

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

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

string getLevel ()
hasChild (line 378)

Check if a child exists identified by $id

boolean hasChild (string $id)
  • string $id: Identifier to look for
listChildren (line 423)

List the IDs of all children in this document

array listChildren ()
numChildren (line 431)

Get the total number of children present in this document

int numChildren ()
preBuild (line 482)

Execute any logic needed prior to building

void preBuild ()

Redefined in descendants as:
removeChild (line 405)

Remove a part from the document

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

Set the content type of this MIME document

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

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

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

Redefined in descendants as:
setEncoding (line 178)

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

void setEncoding (string $encoding, [string $recursive = false])
  • string $encoding: The encoding type used
  • string $recursive: If this encoding format should be used recursively. Note, this only takes effect if no encoding is set in the children.
setHeaders (line 102)

Replace the current headers with new ones

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

void setHeaders (Swift_Message_Headers $headers)
setLE (line 111)

Set the line ending character to use

boolean setLE (string $le)
  • string $le: The line ending sequence
setLevel (line 441)

Set the level at which this document would appear in a nested email

Can be (in order of significance) "mixed", "related" or "alternative" or null

  • throws: Swift_Message_MimeException If this level cannot be set
void setLevel (string $level)
  • string $level: The level at which to insert this MIME document
setLineWrap (line 345)

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

void setLineWrap (int $len)
  • int $len: The length of a line
uncacheAll (line 140)

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

void uncacheAll ()
Class Constants
HTML = "text/html" (line 32)

Constant for HTML emails

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 40)

Constant for safe line length in almost all places

VERY_SAFE_LENGTH = 76 (line 44)

Constant for really safe line length

Documentation generated on Tue, 06 Mar 2007 23:32:26 +0000 by phpDocumentor 1.3.1