Introduction to Zend Framework

 Learning Zend Framework


 Zend Framework Reference

  •  Zend_Gdata
  •  Zend_Http
  •  Zend_InfoCard
  •  Zend_Json
  •  Zend_Layout
  •  Zend_Ldap
  •  Zend_Loader
  •  Zend_Locale
  •  Zend_Log
  •  Zend_Mail
  •  Zend_Markup
  •  Zend_Measure
  •  Zend_Memory
  •  Zend_Mime
  •  Zend_Navigation
  •  Zend_Oauth
  •  Zend_OpenId
  •  Zend_Paginator
  •  Zend_Pdf
  •  Zend_ProgressBar
  •  Zend_Queue
  •  Zend_Reflection
  •  Zend_Registry
  •  Zend_Rest

  •  Zend_Search_Lucene
  •  Zend_Serializer
  •  Zend_Server
  •  Zend_Service
  •  Zend_Session
  •  Zend_Soap
  •  Zend_Tag
  •  Zend_Test
  •  Zend_Text
  •  Zend_TimeSync
  •  Zend_Tool
  •  Zend_Tool_Framework
  •  Zend_Tool_Project
  •  Zend_Translate
  •  Zend_Uri
  •  Zend_Validate
  •  Zend_Version
  •  Zend_View
  •  Zend_Wildfire
  •  Zend_XmlRpc
  • ZendX_Console_Process_Unix
  • ZendX_JQuery
  • Update 2011-11-16 - Revision 24438 - Version ZF 1.11.x

    49.2. Zend_Mime_Message

    49.2.1. Introduction

    Zend_Mime_Message represents a MIME compliant message that can contain one or more separate Parts (Represented as Zend_Mime_Part objects). With Zend_Mime_Message, MIME compliant multipart messages can be generated from Zend_Mime_Part objects. Encoding and Boundary handling are handled transparently by the class. Zend_Mime_Message objects can also be reconstructed from given strings (experimental). Used by Zend_Mail.

    49.2.2. Instantiation

    There is no explicit constructor for Zend_Mime_Message.

    49.2.3. Adding MIME Parts

    Zend_Mime_Part Objects can be added to a given Zend_Mime_Message object by calling addPart($part)

    An array with all Zend_Mime_Part objects in the Zend_Mime_Message is returned from the method getParts(). The Zend_Mime_Part objects can then be changed since they are stored in the array as references. If parts are added to the array or the sequence is changed, the array needs to be given back to the Zend_Mime_Part object by calling setParts($partsArray).

    The function isMultiPart() will return TRUE if more than one part is registered with the Zend_Mime_Message object and thus the object would generate a Multipart-Mime-Message when generating the actual output.

    49.2.4. Boundary handling

    Zend_Mime_Message usually creates and uses its own Zend_Mime Object to generate a boundary. If you need to define the boundary or want to change the behaviour of the Zend_Mime object used by Zend_Mime_Message, you can instantiate the Zend_Mime object yourself and then register it to Zend_Mime_Message. Usually you will not need to do this. setMime(Zend_Mime $mime) sets a special instance of Zend_Mime to be used by this Zend_Mime_Message

    getMime() returns the instance of Zend_Mime that will be used to render the message when generateMessage() is called.

    generateMessage() renders the Zend_Mime_Message content to a string.

    49.2.5. parsing a string to create a Zend_Mime_Message object (experimental)

    A given MIME compliant message in string form can be used to reconstruct a Zend_Mime_Message Object from it. Zend_Mime_Message has a static factory Method to parse this String and return a Zend_Mime_Message Object.

    Zend_Mime_Message::createFromMessage($str, $boundary) decodes the given string and returns a Zend_Mime_Message Object that can then be examined using getParts()

    digg delicious meneame google twitter technorati facebook