Zend_Mime_Part.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.mime.part">
  4. <title>Zend_Mime_Part</title>
  5. <sect2 id="zend.mime.part.introduction">
  6. <title>Introduction</title>
  7. <para>
  8. This class represents a single part of a <acronym>MIME</acronym> message. It contains
  9. the actual content of the message part plus information about its encoding,
  10. content type and original filename. It provides a method for generating a
  11. string from the stored data. <classname>Zend_Mime_Part</classname> objects can be
  12. added to <link
  13. linkend="zend.mime.message"><classname>Zend_Mime_Message</classname></link> to
  14. assemble a complete multipart message.
  15. </para>
  16. </sect2>
  17. <sect2 id="zend.mime.part.instantiation">
  18. <title>Instantiation</title>
  19. <para>
  20. <classname>Zend_Mime_Part</classname> is instantiated with a string that
  21. represents the content of the new part. The type is assumed to be
  22. OCTET-STREAM, encoding is 8Bit. After instantiating a
  23. <classname>Zend_Mime_Part</classname>, meta information can be set by accessing its
  24. attributes directly:
  25. </para>
  26. <programlisting language="php"><![CDATA[
  27. public $type = Zend_Mime::TYPE_OCTETSTREAM;
  28. public $encoding = Zend_Mime::ENCODING_8BIT;
  29. public $id;
  30. public $disposition;
  31. public $filename;
  32. public $description;
  33. public $charset;
  34. public $boundary;
  35. public $location;
  36. public $language;
  37. ]]></programlisting>
  38. </sect2>
  39. <sect2 id="zend.mime.part.methods">
  40. <title>Methods for rendering the message part to a string</title>
  41. <para>
  42. <methodname>getContent()</methodname> returns the encoded content of the
  43. MimePart as a string using the encoding specified in the attribute
  44. $encoding. Valid values are Zend_Mime::ENCODING_* Characterset conversions are
  45. not performed.
  46. </para>
  47. <para>
  48. <methodname>getHeaders()</methodname> returns the Mime-Headers for the
  49. MimePart as generated from the information in the publicly accessible
  50. attributes. The attributes of the object need to be set correctly before
  51. this method is called.
  52. <itemizedlist>
  53. <listitem>
  54. <para>
  55. <varname>$charset</varname> has to be set to the actual charset of the
  56. content if it is a text type (Text or <acronym>HTML</acronym>).
  57. </para>
  58. </listitem>
  59. <listitem>
  60. <para>
  61. <varname>$id</varname> may be set to identify a content-id for inline images
  62. in a <acronym>HTML</acronym> mail.
  63. </para>
  64. </listitem>
  65. <listitem>
  66. <para>
  67. <varname>$filename</varname>
  68. contains the name the file will get when downloading it.
  69. </para>
  70. </listitem>
  71. <listitem>
  72. <para>
  73. <varname>$disposition</varname> defines if the file should be treated as an
  74. attachment or if it is used inside the (HTML-) mail (inline).
  75. </para>
  76. </listitem>
  77. <listitem>
  78. <para>
  79. <varname>$description</varname>
  80. is only used for informational purposes.
  81. </para>
  82. </listitem>
  83. <listitem>
  84. <para>
  85. <varname>$boundary</varname>
  86. defines string as boundary.
  87. </para>
  88. </listitem>
  89. <listitem>
  90. <para>
  91. <varname>$location</varname> can be used as resource <acronym>URI</acronym>
  92. that has relation to the content.
  93. </para>
  94. </listitem>
  95. <listitem>
  96. <para>
  97. <varname>$language</varname>
  98. defines languages in the content.
  99. </para>
  100. </listitem>
  101. </itemizedlist>
  102. </para>
  103. </sect2>
  104. </sect1>
  105. <!--
  106. vim:se ts=4 sw=4 et:
  107. -->